Exit and Reenter same bar

Viewing 15 posts - 16 through 30 (of 38 total)
  • Author
    Posts
  • #70356 quote
    dburgh
    Participant
    Average

    Not a single one provided does what I ask? I have even replied with photographs of the charts disproving them as solutions?

    #70359 quote
    robertogozzi
    Moderator
    Master

    I can’t figure out what your last pic means, why the yellow arrow?

    It’s not a screenshot if your Backtest, is it?

    #70361 quote
    dburgh
    Participant
    Average

    The yellow arrow is showing an example in TradeStation where I can exit on the open and re-enter the next trade on the same open (desired effect). We have yet to find a way to do this in PRT – if so please attach an image of such.

    #70362 quote
    robertogozzi
    Moderator
    Master

    It 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!

    #70363 quote
    Nicolas
    Keymaster
    Master

    Everyone here is helping on their spare time, so please be patient 😉

    Orders are not “merged”, they exit and they open at next Open (attached picture).

    order-open-and-close-at-open.png order-open-and-close-at-open.png
    #70366 quote
    dburgh
    Participant
    Average

    Ok, I did not think it was possible. Thank you for helping and confirming. I will wait until upgraded to continue support for PRT.

    #70368 quote
    dburgh
    Participant
    Average

    Nicolas,

    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

    #70381 quote
    Nicolas
    Keymaster
    Master

    It 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

    #70384 quote
    dburgh
    Participant
    Average

    Please advise as this solution does not work. You can see in the green box trades are lasting longer than 1 bar and there are no examples of ‘re-entering’ on the same open as an exit.

    PRT_Example4.png PRT_Example4.png
    #70417 quote
    robertogozzi
    Moderator
    Master

    It 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.

    #70419 quote
    dburgh
    Participant
    Average

    This 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).

    PRT_Example5.png PRT_Example5.png
    #70425 quote
    robertogozzi
    Moderator
    Master

    Sorry, I can’t replicate it without info.

    #70427 quote
    dburgh
    Participant
    Average

    The info is in the photos. So is the code. Should have no trouble replicating.

    2 years of daily SP500 index.

    Thanks,

    David

    PRT_Example6.png PRT_Example6.png
    #70438 quote
    robertogozzi
    Moderator
    Master

    Sorry, 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!

    US-index.jpg US-index.jpg
    #70441 quote
    dburgh
    Participant
    Average

    Robert, 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.

    PRT_Example7.png PRT_Example7.png
Viewing 15 posts - 16 through 30 (of 38 total)
  • You must be logged in to reply to this topic.

Exit and Reenter same bar


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
dburgh @dburgh Participant
Summary

This topic contains 37 replies,
has 4 voices, and was last updated by dburgh
7 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/08/2018
Status: Active
Attachments: 12 files
Logo Logo
Loading...