Exit and Reenter same bar
Forums › ProRealTime English forum › ProOrder support › Exit and Reenter same bar
- This topic has 37 replies, 4 voices, and was last updated 5 years ago by dburgh.
-
-
05/14/2018 at 1:25 PM #7035605/14/2018 at 1:36 PM #70359
I can’t figure out what your last pic means, why the yellow arrow?
It’s not a screenshot if your Backtest, is it?
05/14/2018 at 1:40 PM #7036105/14/2018 at 2:01 PM #70362It is NOT possible to reenter within the same bar, because each strategy is executed at the END of a bar, so once a trade is entered ProOrder won’t check conditions again before the bar closes.
When the expected MTF (Multi Time Frame) will be available, it is rumoured before the end of this year, a workaround will be to use lower TFs (even a 1-second TF) to check if a trade has been closed and conditions are still valid to open a new one. You will be able to write a strategy for higher TFs, but still being able to take control of what’s going on much earlier that THAT bar is closed!
05/14/2018 at 2:01 PM #7036305/14/2018 at 2:04 PM #7036605/14/2018 at 2:10 PM #70368Nicolas,
if your image shows one trade exiting on the open and the second trade entering on the same open then that is exactly what I am after! Do you have code to produce this you can share? I am not able to replicate this with any of the previous code in this thread.
Thanks,
David
05/14/2018 at 3:24 PM #70381It seems you’ve already been given solutions.
Roberto was right, this is the code from that post: https://www.prorealcode.com/topic/exit-and-reenter-same-bar/#post-70135
05/14/2018 at 3:47 PM #7038405/14/2018 at 6:44 PM #70417It did last ONE bar, you may take note that the closing price of that trade is the closing of the previous bar, BUT when a daily bar closes it’s a new day, so I guess ProOrder displays the cross above the new bar, but actually that trade did not last more than one bar!
Anyway, can you tell me the instrument, dates and time of your backtest so I can replicate it. Thanks.
05/14/2018 at 6:51 PM #70419This does not make sense at all. It should exit where the orange line is (and orange drawn ‘x’ is) with a one bar hold exit. It should also re-enter a new trade at the orange line as previous bar has entry condition (low[0] <= low[1] == True).
05/14/2018 at 7:08 PM #70425Sorry, I can’t replicate it without info.
05/14/2018 at 7:11 PM #7042705/14/2018 at 11:57 PM #70438Sorry, but I can’t find that index. I tried it on DAX daily and I could not find any trade lasting more than one bar!
05/15/2018 at 12:41 AM #70441Robert, please show your code and proof. I have ran the ‘solution’ code on DAX (as you have claimed to do) and you can clearly see in the attached image it is holding trades for longer than one bar and there are NO instances of a trade exit occurring on the open and a re-entry occurring on that same open.
If this cannot be done in PRT then please just say that. However, please do not tell me there is a solution if when there is not.
This is a huge waste of time. if there is a solution then great please provide code and visual proof. If not, then just say so! Why are you making this more difficult than it has to be?
For the record, the ‘US 500’ is the S&P500 (Standard and Poor’s 500) index from the United States. Regardless, it does not matter the symbol this code is run on – I think you know that.
-
AuthorPosts
Find exclusive trading pro-tools on