Position buildup on existing order
Forums › ProRealTime English forum › ProOrder support › Position buildup on existing order
- This topic has 13 replies, 3 voices, and was last updated 6 years ago by
Albaran.
-
-
09/11/2019 at 5:37 PM #107224
Hi all,
I’m having a hard time to figure out a formula for the number of additional contracts I have to buy for an existing position.
The idea is that each time the index drops 6 points from my last tradeprice (so with a limitbuy= TradePrice – 6) I add long to my existing position with my formula and that when it does I want to have a positionprice <= 10 points removed from the current close.
My excell formula works just fine but when testing it in Prorealtime I see a slight difference that worsens over time when additional contracts are bought (results between my excell sheet and what prorealtime does are not the same).
My guess is that I don’t account for the spread I have to pay in my excell formula, hence the difference between the number of contracts I have in my excell table and what the system does in virtual life testing.
So my formula for buying additional contracts looks like this: (((PositionPrice-TradePrice-4)*countoflongshares)/10).
This formula works just fine in excell like previously said but fails to come up with the same number of contracts when ran in prorealtime.
This formula has been/ is being tested with the mini indice CAC40.
Could you give me some insight/ explanation/ help?
Much appreciated,
09/11/2019 at 5:43 PM #10722509/11/2019 at 5:54 PM #10722609/11/2019 at 6:38 PM #107241Spread is not the problem I think as if you place a pending order to buy at x price then you will buy at x price (allowing for slippage). If you wanted to sell immediately then you would find that you can’t at x price any more as the price to sell is x – spread.
09/11/2019 at 7:12 PM #10725609/11/2019 at 7:59 PM #10726109/11/2019 at 8:48 PM #10727109/12/2019 at 7:36 AM #10731109/12/2019 at 9:21 AM #107323@Nicolas: the number of bars that elapsed since the opening of the first order is subject to the market. I can’t say, it’s variable.
What I can say is that the number or additional contracts calculated by PRT does not change over time. Once calculated, it sticks to the number it has calculated.
I’m really puzzled…
09/12/2019 at 10:39 AM #10734109/12/2019 at 10:53 AM #107345The new position size is calculated at the same time it adds a new limit order.
So if the very first order has been placed (so on the market), the new position size will be calculated immediately at the next bar, as well as the level at which it will be bought at.
Code is read from top to bottom.
09/12/2019 at 11:15 AM #10734609/12/2019 at 12:28 PM #107348I figured it out I think.
It does come up with the same results with GRAPHONPRICE.
Because I was impatient I wanted to test out whether the number of additional contracts would correspond with my excell sheet.
In order to see this, I bought a random number of contract to get to the positionbuildup in my excell sheet but failed to take into account that 6 contracts bought at the same level and 6 contracts bought at different levels would not give me the same results with my formula, hence the difference.
09/12/2019 at 12:30 PM #107349 -
AuthorPosts
Find exclusive trading pro-tools on