Forums › ProRealTime English forum › ProBuilder support › EMA with a horizontal and verticle shift › Reply To: EMA with a horizontal and verticle shift
05/19/2022 at 4:43 PM
#193461
The full code is too big to post plus it’s not mine to do so, it’s one that i’m working on as a trader. but this is the section i have for the MA’s. The top two lines determine the MA’s which are set in variable optimisation to 3 and 5.
the next line down determines the conditions which have to be met to take a long. So i want EMA 3 (EMAPer1) to be over the EMA5[1horizontal shift] (EMAPer2) by the Pointsize difference or more. This value is currently set to 5 which is shown on the 4th line down. I have this further up the page.
1 2 3 4 |
ema30HS = exponentialaverage[EMAPer1](close) ema31HS = exponentialaverage[EMAPer2](close[1]) EMAbuyc = ema30HS-ema31HS>ema30HSema31HSDistance*pointsize |
1 |
Once ema30HSema31HSDistance = 5 |