Forums › ProRealTime English forum › ProOrder support › Heiken Ashi Long/Short › Reply To: Heiken Ashi Long/Short
04/25/2018 at 9:38 PM
#69174
Inertia,
If you have time
One more thing. Do you know why this code is not shorting the market?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
//conditions to enter long positions c1 = Close<Open[5] and Close>Close[3] indicator2 = RSI[30](close) c3 = (indicator2 >50) indicator3 = CCI[65](close) c4 = (indicator3 >65) indicator4 = exponentialaverage[20](close) c5 = (close >indicator4) if c1 and c3 and c4 and c5 and Not LongOnMarket then BUY 1 SHARE AT MARKET endif // conditions to exit long positions indicator1 = ExponentialAverage[50](close) c2 = (close CROSSES UNDER indicator1) IF c2 THEN SELL AT MARKET ENDIF //conditions to enter short positions c6 = Close>Open[5] and Close<Close[1] indicator2 = RSI[30](close) c7 = (indicator2 <50) indicator3 = CCI[65](close) c8 = (indicator3 <-10) indicator4 = exponentialaverage[20](close) c9 = (close >indicator4) if c6 and c7 and c8 and c9 and Not shortOnMarket then BUY 1 SHARE AT MARKET endif // conditions to exit long positions indicator1 = ExponentialAverage[50](close) c10 = (close CROSSES over indicator1) IF c10 THEN SELL AT MARKET ENDIF // stops and targets atr = averagetruerange[14](close) set stop ploss atr*2.5 |
Thanks