Hello everybody and thanks in advance.
I wrote this "script" (it is 5 lines long...) just to test the function "ta.highest" and it does not open any trade... and I can't figure out why.
//@version=5
strategy("La mia strategia", overlay=true, initial_capital = 10000, default_qty_type = strategy.percent_of_equity, default_qty_value = 100 )
longCondition = close > ta.highest(high, 7)
closeCondition= close < ta.lowest(low, 7)
if (longCondition)
strategy.entry("My Long Entry Id", strategy.long)
if closeCondition
strategy.close("My Long Entry Id")
Anybody can help? Thank you.
The condition is reached multiple times (a close which is higher than the previous 7-days highest high) but pinescript seems to not recognize it... or I misunderstand the logic of the function "ta.highest"?