Trigun1127
Member
Are { } supposed to be used here? I'm getting invalid If Statements as well.
Code:# This variable will store the largest gap of the past five big gap opens input bigGapSize = 0.01; # This variable will store the daily range of the past 21 days input dailyRange = 0.01; # Calculate the current gap size def currentGapSize = open - close[1]; # Calculate the daily range for the past 21 days def range21 = Highest(high, 21) - Lowest(low, 21); # Check if the current gap size is the largest of the past five big gap opens if (currentGapSize > bigGapSize) and (currentGapSize > open[1]) and (currentGapSize > open[2]) and (currentGapSize > open[3]) and (currentGapSize > open[4]) { # If it is, set the bigGapSize variable to the current gap size bigGapSize = currentGapSize; } # Check if the current gap size is 100% of the daily range for the past 21 days if (currentGapSize / range21 == 1) { # If it is, plot a dot on the chart plot dot = open; dot.SetPaintingStrategy(PaintingStrategy.DOT); }