Going back on candles
1 replies
Brignac Roofing
11 years ago #113318
I’m trying to understand something I need clarification with. I will try and make it easy as possible to explain.
If EMA 10 > EMA 20
And my strategy was say MACD 12,26,9 CROSSES BELOW 0 Line THEN
Enter Short
But my question is, How do I tell the EA to make sure that 10 has been greater than 20 for at least ten candles back?
I say that b/c it helps the strategy from not trading when the EMA 10 and EMA 20 are moving up and down on the 5min. charts within like 2 candles or so.
Do I set my shift parameters to 10 to make sure that EMA 10 has been above EMA 20 for at least ten candles?
0
Mark Fric
11 years ago #128804
you can use Shift for this, but Shift will check teh value only in one candle.
If you want to check that for last 10 bars EMA (10) > EMA(20) you have to repeat it 10 times:
IF
EMA(10, 1) > EMA(20, 1)
and EMA(10, 2) > EMA(20, 2)
and EMA(10, 2) > EMA(20, 2)
…
and EMA(10, 10) > EMA(20, 10)
where the second parameter is Shift.
Mark
StrategyQuant architect
0
Viewing 1 replies (of 1 total)