Two limit orders to close position
Forums › ProRealTime English forum › ProOrder support › Two limit orders to close position
- This topic has 8 replies, 3 voices, and was last updated 7 years ago by
Madrosat.
-
-
06/29/2018 at 5:37 PM #74845
I’ve written a strategy and when it opens a position with a limit order it sets two limit orders to sell the complete position at medianprice and high and repeats them until the position is closed.
12Sell 1 contract at MedianPrice limitSell 1 contract at high limitI get great results (too good to be true!) but I noticed that they are different depending upon which order I place the limit orders in. At first I thought it was because maybe you can only have one limit order and so it ignores the first one but checking the trades this does not seem to be the case. I tested each limit order on its own and the results are totally different to the combined limit orders so it can’t be that.
Here is the equity curve with the median price limit first in the code followed by the high limit:
…and here is the same code with the high limit listed first:
….and the median price limit on its own:
….and the high limit on its own:
The entry is at a low price and so should always be below the last bars median price and high so I am a bit confused by the results. I do get a lot of zero bar exits (entry and exit in the same bar) but these appear to be valid when the candles are checked – and yes I do have tick by tick turned on.
Any suggestions what is going on.
06/29/2018 at 5:54 PM #7485106/30/2018 at 8:25 AM #7488506/30/2018 at 8:49 AM #74890What do you mean by ” these appear to be valid when the candles are checked ” for me all my backtests with entrance and exit on same candle are false??
They should not be false if tick by tick data is used. If tick by tick is not selected then yes any strategy that has intra-bar opening and closing will give false results. Before tick by tick was available in PRT this was a major source of people thinking that they had great results when in fact they didn’t.
06/30/2018 at 8:59 AM #74893My original intention was to have partial closure at the last bars median price and then full closure at the last bars high but I found when optimizing that I got the wonderful equity curves with full closure at either median price or high but only if both limits were in the code. Then I realised that it should always hit the median price limit first and so something was not right. While testing each limit I then noticed that the results changed depending upon the order in which they are put in the code. So I then looked at the candles and noticed that sometimes the median price limit is completely ignored as price moves through it and at other times it is not. It is almost as if it is random as to which limit order is put on the market – either that or the tick by tick data is flawed or the tick by tick test is not carried out correctly.
If a reason cannot be given here then I will send a report to PRT and post something in the support forum pointing to this topic.
06/30/2018 at 9:05 AM #74895for me all my backtests with entrance and exit on same candle are false??
You mean – up to this point – you thought they were false??
If you go back through a trade with a tick chart then you can check what is happening. This is how I discovered – nearly 3 years ago – that the zero bars garbage that PRT Platform was allowing us – during backtest and before tick by tick mode was available – to think we could be millionaires! 🙂
07/01/2018 at 5:12 AM #7497107/01/2018 at 8:04 AM #74975I repeat all backtest with entrance and exit on the same candle are false
When was that test carried out? If during this weekend then you might want to read this post that I put in the support forum yesterday – I think I worked out my own answer:
https://www.prorealcode.com/topic/tick-by-tick-not-working-correctly/
07/02/2018 at 7:00 AM #75046 -
AuthorPosts
Find exclusive trading pro-tools on