cross under not satisfied but still entered
Forums › ProRealTime English forum › ProOrder support › cross under not satisfied but still entered
- This topic has 9 replies, 2 voices, and was last updated 3 years ago by
robertogozzi.
-
-
03/07/2021 at 4:33 AM #163334
hi,
the low of the candle has not cross under the ema 37 line but still entered a long position. any reason why?
12345678910111213//conditions to go longlongc1 = ema37 - ema50 > 0.0002longc2 = high[1] < high[2] and high[2] < high[3]longc3 = (low[1] crosses under ema37) or (low[1] crosses under ema50)longc4 = (close[1] > ema50) and (close[2] > ema50) and (close[3] > ema50)longconditions = longc1 and longc2 and longc3 and longc4//long entry triggerbuyentry = close >= high[1]if not onmarket and longconditions and buyentry thenbuy 1 contracts at marketendifthank you
03/07/2021 at 4:34 AM #16333503/07/2021 at 4:35 AM #163338i thought it may be because of the spread but i tried changing it to 0 to some other number but the results are still the same.
03/07/2021 at 4:36 AM #16333912345678910111213141516//indicatorsema37 = ExponentialAverage[37](close)ema50 = ExponentialAverage[50](close)//conditions to go longlongc1 = ema37 - ema50 > 0.0002longc2 = high[1] < high[2] and high[2] < high[3]longc3 = (low[1] crosses under ema37) or (low[1] crosses under ema50)longc4 = (close[1] > ema50) and (close[2] > ema50) and (close[3] > ema50)longconditions = longc1 and longc2 and longc3 and longc4//long entry triggerbuyentry = close >= high[1]if not onmarket and longconditions and buyentry thenbuy 1 contracts at marketendifforgot the indicators
03/07/2021 at 4:43 AM #163341Line 4 is logically wrong, it can’t test a cross under between the previous LOW and current EMA’s.
Replace it by:
1longc3 = (low crosses under ema37) or (low crosses under ema50)03/07/2021 at 4:45 AM #163342Do not use 0.0002, rather 2*PipSize.
03/07/2021 at 4:57 AM #163343but one of the conditions is if the previous low crosses under those ema or value of it less than the ema. i do not want the lastest candle.
03/07/2021 at 5:00 AM #163344when i try to replace line 7 with
1longc3 = (low[1] < ema37) or (low[1] < ema50)results are the same.
03/07/2021 at 5:02 AM #163345got it
i did this
1longc3 = (low[1] crosses under ema37[1]) or (low[1] crosses under ema50[1])03/07/2021 at 7:20 AM #163346That looks good!
-
AuthorPosts
Find exclusive trading pro-tools on