Ecuador, esmeraldas , tonsupa
Posts: 2 since Apr 2020
Thanks Given: 1
Thanks Received: 0
|
Hello community of traders.
I am new to Easylanguage. I have problems in my code when I want to use the reserved word BarsSinceExit, in my strategy I want to launch a purchase order after 10 bars of having closed a position, when I uncertain that I do this for a long order it executes it correctly but when it is uncertain in the short order it does not and no long or short order appears, that is, the BarsSinceEntry only works for a long order or a short order but not for both simultaneously.
I do not know what I am doing wrong, I attach my code so please indicate to me what I am doing wrong or give me another alternative to get me to enter a position after having closed (10 or 9 or 5) bars behind.
input: DesicionBarintervalexit (10)
if close > high [1] and Barssinceexit (1) >= DesicionBarintervalexit then
BUY ("B1") next bar at market;
end;
if close < high [1] and BarsSinceEntry (1) >= DesicionBarintervalentry then
SELLSHORT ("S1") next bar market;
I await your comments, thank you in advance to all who can help me.
|