This is my first question on forum. I am facing an issue while strategy testing because I want to enter in Trade only if next candle is high to previous .
I used a possible ways to sort out but it is not a precise solution, so pls guide.
Order is not placing at Buy_true value i.e. Buyprice, it is always on Close. My requirement is Entry on next Bar when High is above previous High, and entry price should Buyprice. (High + 2% I added formula).
I trying to add picture here in forum, but not showing option to browse and attached picture.
so uploaded in external link.
https://ibb.co/58dxT20
Code: Select all
// Next Bar after buySignal check for High greater than earlier high DO NOT DELETE
Buy_true = ta.valuewhen (buySignal,Buyprice,0)
Barhigh = high >= high [1]
Bar_Entry = (high >= high [1]) and (buySignal [1] )
plot (Buy_true)
if Bar_Entry
strategy.entry(id="Long", direction=strategy.long, limit = Buy_true, stop = Buy_true)