How can I code to return the highest price since the Moving Average Crossover, and so do the lowest price since the moving average crossunder?
How can I code to return the highest price since the Moving Average Crossover, and so do the lowest price since the moving average crossunder?
Use a var variable to keep track of the price. Reset this when there is a crossover or crossunder.
var float highest_high = na
if (sma_crossover) // Check for crossover
highest_high := high // Reset your variable
else
if (high > highest_high)
highest_high := high // Update the highest high