I'm developing strategy using some dynamic indicators.
Having trouble to set "flags" for entering.
F.e. I have 2 SMA's which showing me the trend and a variable Crossover which comes true when 2 SMA's crossing each other. And I want ONLY ONE TRADE from ONE crossover. Then - just waiting for another one.
if (CrossAbove(SMA(14), SMA(50), 1){
Crossover = true;
}
So I'm printing:
if (SMA(14)[0] < SMA(50)[0]{
Crossover = false;
}
if (Crossover==true){
EnterLongLimit(Indie, "EnterLong");
Crossover=false;
}
What I'm doing wrong?
Thanks!
Update:
If I'm using just EnterLong() and EnterShort() method this "flag" of variable Crossover works good and I have only one enter from each crossover. But when I'm putting EnterLongLimit - have no entries at all - only cancelling of orders.


Comment