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.
Sell 1 contract at MedianPrice limit
Sell 1 contract at high limit
I 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:
[attachment file=”MedianPrice First.png”]
…and here is the same code with the high limit listed first:
[attachment file=”high limit first.png”]
….and the median price limit on its own:
[attachment file=”Just medianPrice limit.png”]
….and the high limit on its own:
[attachment file=”Just high limit.png”]
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.
Here is an image confirming that it is using both limit orders. I would expect it to always hit the previous bars median price limit first but sometimes it does and sometimes it ignores it and closes at the level of the previous bars high.
[attachment file=74852]
Vonassi
What 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??
What 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.
My 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.
for 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! 🙂
I repeat all backtest with entrance and exit on the same candle are false
see one example on graph with tick by tick coché
May be with the multitime frame they will be right ???
I 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:
Tick by tick not working correctly.
this morning 2 false trades Iin backtest
tick by tick coché and exit on set target pprofit
Why???