Error with orders partially close a position
Forums › ProRealTime English forum › ProOrder support › Error with orders partially close a position
- This topic has 4 replies, 4 voices, and was last updated 8 years ago by
robertogozzi.
-
-
12/21/2017 at 7:42 PM #56282
Hello guys, I get the error in the image with the code in attached below. I do not understand what the problem is, I think the code should not leave pending sizes open and complain. Can you help_ Thanks, Edoardo
Error with orders partially close a position1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859//Modified system by EZ - 20th Dec 2017DEFPARAM CumulateOrders = True // Cumulative orders allowed.DEFPARAM FlatBefore = 060000 // Cancel any pending orders, close any positions and prevent placement of additional orders.DEFPARAM FlatAfter = 210000 // Cancel any pending orders, close any positions and prevent placement of additional orders.Size = 10 //position sizeStopLoss = 10 //stoploss in pointsTakeProfit = 20 //takeprofit in pointsXcandlesticks = 3 //consecutive bullish or bearish candlesticks to open a new positionXcandlesticks1 = 1InverseTrading = 0 //(0=false ; 1=true) trade in the same direction of the candlesticks pattern or not//Flapping based on low double deviationdoubdev = 4*STD[2](close)//detecting patternsbearpattern = summation[Xcandlesticks](close<open)=Xcandlesticksbullishpattern = summation[Xcandlesticks](close>open)=Xcandlesticksbearpattern1 = summation[Xcandlesticks1](close<open)=Xcandlesticksbullishpattern1 = summation[Xcandlesticks1](close>open)=Xcandlesticks//first order - buyif not onmarket and doubdev > 5 thenif bearpattern thenif InverseTrading thenBUY Size CONTRACTS AT MARKETelseSELL Size CONTRACTS AT MARKETendifendifendifif bullishpattern thenif InverseTrading thenSELL Size CONTRACTS AT MARKETelseBUY Size CONTRACTS AT MARKETendifendif//first order - sellif longonmarket and bearpattern1 thenSELL Size CONTRACTS AT MARKETendifif shortonmarket and bullishpattern1 thenBUY Size CONTRACTS AT MARKETendifSET STOP LOSS StopLossSET TARGET PPROFIT TakeProfit12/21/2017 at 8:17 PM #5628812/23/2017 at 3:27 PM #5643312/23/2017 at 3:45 PM #5643512/23/2017 at 3:46 PM #56436Nicolas wrote: “Close partially positions is only possible through paper trading and demo, not in live environment with ProOrder“.
Apart from changing the keywords so that you use the correct ones, you should remove every attempt to close partially positions (the message box from PRT is clear).
So you can only SELL and EXITSHORT, you can search the forum for those two keywords to find out manual details and lots of examples.
-
AuthorPosts
Find exclusive trading pro-tools on