Forums › ProRealTime English forum › ProOrder support › missing code for closing order @ next bar open › Reply To: missing code for closing order @ next bar open
08/13/2018 at 4:19 PM
#78088
Here is the amended code…
It’s ony working for long positions. Short didn’t work well.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
A = Close[1]-Open[1] //inner Range B = High[1]-Low[1] //outer Range C = y //Faktor n = 1//Lotsize // Conditions to enter long positions IF NOT OnMarket AND (A/B) < C THEN BUY n SHARES AT MARKET ENDIF // Conditions to exit long and short positions IF OnMarket THEN SELL AT Market ENDIF |
For C = 0,43 worked best