Open more positions
Forums › ProRealTime English forum › ProOrder support › Open more positions
- This topic has 7 replies, 2 voices, and was last updated 4 years ago by Vonasi.
-
-
11/12/2019 at 6:13 PM #112622
Want some help with a code.
If an algo takes a long position and lies back 20 points, I want a new position to take too long.
After all, in my manual trade, I usually take 3-4 positions to get in “right”.
Another question.
If my algo takes a long position in DAX with 0.5 contract and I want to open a long position to can I take an even smaller position then?
0.25 contract?
My total position will then be 0.75 contract.
Know that minimum position is 0.5 contract but if you already have a position of 0.5 and add on it then it should work or?
11/13/2019 at 10:37 AM #112656Found this from Vonasi
But, i want to buy if my position go at the wrong way with 20 points.
123456789DEFPARAM CumulateOrders = trueIF not OnMarket and (your conditions) thenBuy 1 contract at marketENDIFIF OnMarket and (your conditions) and close > PositionPrice thenBuy 1 contract at marketENDIF11/13/2019 at 10:45 AM #112657This code should do the trick..or?
123456789101112DEFPARAM CumulateOrders = truePOSITIONSIZE=1// Conditions to enter long positionsIF (my conditions) thenBUY POSITIONSIZE CONTRACTS AT MARKETENDIFif longonmarket and close - tradeprice < 20*pointsize thenbuy 1 contract at marketendif11/13/2019 at 12:11 PM #112670So you want to open a long position and then average down every time price drops at least 20 from your last trade price?
123456789101112DEFPARAM CumulateOrders = truePOSITIONSIZE=1// Conditions to enter long positionsIF not onmarket and (my conditions) thenBUY POSITIONSIZE CONTRACTS AT MARKETENDIFif longonmarket and close < tradeprice - 20 thenbuy 1 contract at marketendifAs for opening smaller positions after the initial trade. You can only do this if the position size is greater than the minimum position size allowed by your broker. All orders are treated separately and must be at or above the minimum size allowed.
11/13/2019 at 1:06 PM #11267711/13/2019 at 1:28 PM #11268012345678910111213DEFPARAM CumulateOrders = truePOSITIONSIZE=1maxpositions = 2// Conditions to enter long positionsIF not onmarket and (my conditions) thenBUY POSITIONSIZE CONTRACTS AT MARKETENDIFif longonmarket and close < tradeprice - 20 and countofposition < maxpositions thenbuy 1 contract at marketendif11/13/2019 at 1:40 PM #11268211/13/2019 at 3:17 PM #112698Yes that is because buy and sell takes place in the same bar. The only way to change it is by changing your exit conditions! Perhaps you have a very close stop loss or take profit target? If so then these will look great in back testing but in real life your broker will reject all your orders and your strategy will fall to pieces.
-
AuthorPosts
Find exclusive trading pro-tools on