capturing fast movements + data collection

Forums ProRealTime English forum ProOrder support capturing fast movements + data collection

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • #88998

    Today I have 2 separate question, but for the interest of brevity decided to use a single thread for both (let me know if this combination is not useful…)

    1. Fast movements:
      In the attach image you can see a trade from the DJI. It was a Sell that reach it’s stop loss (bar 1) and went into a Buy (bar 2) that exited on a protective stop loss.
      The problem is that each bar is 5 minutes and it only switches to Buy on bar 2 and misses out on most of the move up that occurred on bar 1.
      I thought the Buy and Sell are done in real time and do not wait for the end of the next bar to be executed. Are they not?
      here is the code I use to set the Buy/Sell, what am I missing here?

    2. Data collection. Currently using the 5 min bars I can back-test about year in the past. Is there any way to download this market data a year back so I can keep on using it a year from now before the time frame moves and blocks data from Jan 2018 onward?
    #89002

    1. strategies are always executed when a bar closes, microseconds before the new one opens. You’ll have to resort to MTF to achieve what you want and use 1 minute as your main (default TF on chart) to enter/exit while using 5 minutes for conditions.

    2. No, it is not possible as of the current version of PRT.

    1 user thanked author for this post.
    #89019

    Thanks robertogozzi,
    I may have found anther solution that does not include TF.

    I see that if I hedge the trade then it goes in as soon as the other trade stops.

    that is, I added Buy orders inside the “IF SHORTONMARKET THEN” clause and vice versa on the Long side.

    looking at the example I sent yesterday it seems to work, but since I am a newbie, I am wondering if I am missing something here.

    Also, is there another more official way to hedge using the code?

    #89026

    I never tried hedging, and I don’t know if ProOrder supports it. As far as I know when you are LongOnMarket and execute a SELLSHORT it should close the long trade and open a new Short one, but I never tried this.

    This link (french forum) may help https://www.prorealcode.com/topic/cumuler-buy-et-sellshort-en-meme-temps/#post-40200.

    #89099

    Thanks,

    In my case I was not selling and buying at the same time but needed the sell to begin *immediately* if the buy reached it’s StopLoss (so the Buy StopLoss would be the Sell’s trigger order)

    in the “normal” code I had to wait till the end of the next bar to do it as explained above, but by “hedging” as I showed earlier it triggered immediately.

    I hope it helps anyone else who is looking for such a solution.

    Thanks again for all your help!

    #89101

    Pending orders DO NOT wait for bars to close (at-market orders do) to open a trade. They even don’t care about DEFPARAM CUMULATEORDERS=FALSE in case both Short & Long conditions are met on the same bar, because ProOrder only becomes aware of what happened when a bar closes, not while it is forming.

    Each pending order expires at the end of each bar and needs to be placed again, if needed.

    I can’t tell WHEN MyBuyprice was hit. I suggest that you use GRAPH to spot any unwanted behaviour.

    In bar 0 (not tagged, but it’s the setup bar just before bar 1)  ProOrder placed your two pending orders. Then the short one was triggered on bar 1, while MyBuyprice was not hit (that’s what you need to check with GRAPH) and ProOrder, at the end of Bar 1 placed again that order since conditions were still met, then on Bar 2 it was triggered.

    From your pic it seems that bar 1 never reached MyBuyprice, but I cannot tell why without the complete code, TF and dates involved.

     

     

Viewing 6 posts - 1 through 6 (of 6 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login