Forums › ProRealTime English forum › ProOrder support › Heiken Ashi Long/Short › Reply To: Heiken Ashi Long/Short
04/25/2018 at 9:54 PM
#69178
Inertia,
If you have time
One more thing. Do you know why this code is not shorting the market?
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 //conditions to enter long positionsc1 = 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 thenBUY 1 SHARE AT MARKETendif// conditions to exit long positionsindicator1 = ExponentialAverage[50](close)c2 = (close CROSSES UNDER indicator1)IF c2 THENSELL AT MARKETENDIF//conditions to enter short positionsc6 = 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 thenBUY 1 SHARE AT MARKETendif// conditions to exit long positionsindicator1 = ExponentialAverage[50](close)c10 = (close CROSSES over indicator1)IF c10 THENSELL AT MARKETENDIF// stops and targetsatr = averagetruerange[14](close)set stop ploss atr*2.5Thanks