how to code :- if ema2 cross above sma9 appears before ema2 cross above ema5 then buy.
-
i have two ema( 2 & 5) and 1 sma (9). when ema2 crosses sma9 then it crosses ema 5 above then i wish to take buy trade. cross can be compared in terms of time. suppose ema2 crosses above sma9 @ 16:01:35 then ema2 crosses ema5 above @ 16:01:37 then buy trade
-
@kunalyadav1809 What's the point of waiting for two seconds after the crossing happened? Why not as soon as the crossing happened?
-
@l-andorrà Sure sir, just for confirmation that ema 2 must cross ema5 and sma9 and in that condition Time 1( ema2X>sma9) is < Time 2 (Ema2 X> sma9) only then sell. Difference in time can be in microseconds even.
-
is there any way to compare crossings....i think if we keep record of crossing through Time or price, then we can compare which crossing appeared before. then execute trade
like ema2 X sma9 crossed @ price P1 or Time T1
and
ema2 X ema5 @ Time 2 or Price P2
is there any way to define this.....
-
The idea of Crossovers is to place a trade just after crossing or we can count pips after crossing but not seconds.
-
@masim1 like u said sir..............difference in price will also work....pips is the difference in price.....
-
@kunalyadav1809 The problem with crossings is that what we humans see on the chart is not what a crossing is for the terminal.What we call crossings is a comparison of two MA values between two consecutiva candles. That 'crossing price' is a visual artifact, not a real price.