MTF – one trade per bar

Forums ProRealTime English forum ProOrder support MTF – one trade per bar

Tagged: ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • #95906

    Example:

    I am using 2 timeframes, 10 minutes and 1 second. Suppose when OnMarket, after it reaches my stoploss, I don’t want the program to open another position within the same bar my stoploss was reached.

    Anybody can help me how to get this done? I searched for it on the forum, but can not find it.

    Thanks in advance…

    #95908

    On which TF, 10-minute or 1-second?

    On 1-second TF it is impossible to acrivate more than one order each bar, since strategies are executed when a bar closes, so another trade could only be opened the next bar, not the same one.

    On a 10-minute TF you should add, at the very beginning of that code (provided UPDATEONCLOSE is used):

    Next, at the very beginning of the code on your 1-second TF, add:

    Then add TradeON to your conditions to enter a trade and clear it to avoid further trading until the next 10-minute bar:

    edited on May 5th, 2021:

    lines

    do not work properly and should be replaced by this single line:

     

     

     

     

     

     

    1 user thanked author for this post.
    #95909

    Thank you, Roberto…

    I am using 5 timeframes, but just used 10 minutes and 1 sec. as an example. Thank you for the code.

    #95913

    The first lines of code I posted;

    should be added to only one TF, i.e. if you are using Daily+h4+h1+10-minute+default(1-second), then if you add that code on the 10-minute TF your next trade would not open till the next 10-minute bar.

    If you add it, instead, to your 1-hour TF, only one trade per hour will be allowed, and so on…

     

    1 user thanked author for this post.
    #95922

    I added to here

    Snippet Link Library

    Please could one reader say if you see the link above as the words … ‘Snippet Link Library’ … or something else?

    2 users thanked author for this post.
    #95937

    We see correctly the link GraHal , do not worry 😉

    Snippet Link Library

    1 user thanked author for this post.
    #168806

    Actually lines:

    do not work properly (thanks to MauroPro at  https://www.prorealcode.com/topic/singola-operazione-multitimeframe/) and should be replaced by this single line:

    I also edited in RED the original post above (so the link in the Snippet Library is still valid).

     

     

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

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