Breakout Strategy on the candle stick – please Help!!

Forums ProRealTime English forum ProBuilder support Breakout Strategy on the candle stick – please Help!!

Viewing 5 posts - 16 through 20 (of 20 total)
  • #248874

     

    #248876

    The lines:

    use VALUE1 and VALUE2 as boolean variables, but they are NOT boolean variables as they are prices (high and low), so they will ALWAYS be true.

    Can you explain what’s their purpose?

    Moreover, the lines:

    will always be BOTH executed. Since they are read and executed sequentially, the last one written in the code will override all prior SET STOP LOSS instruction; in this case only StopLoss1 will always be the real stop loss.

    You should make them different by executing one of them for LONG trades and the other one for SHORT trades, this way:

    I also added the SET STOP PROFIT to 1:3 ratio, which you can change as best suits you.

     

     

    #248877

    Hi Roberto,

    Thank you very much as always. 🙂

    I think I have removed everything and made it a bit clearer. Removed  VALUE1 and VALUE2 

    Can I ask, If one of the orders got triggers long or short, will this not cancel the other order? Let’s say if the long order got triggered, short order should be cancelled and the long order SL should be the same within that tradingtime right?

    if not both orders will get trigger. if the long order get triggered aggressively and hit the SL then short order will get triggered at the same time. is there a way to stop this?

    #248885

    Line 3 could simply read:

    To make sure pending orders not triggered are not placed again (they are automatically cancelled each bar, so you simply have to stop placing them when already at market), so replace both IF NOT LongOnMarket AND tradingtime THEN and IF NOT ShortOnMarket AND tradingtime THEN by:

    As to “if not both orders will get trigger. if the long order get triggered aggressively and hit the SL then short order will get triggered at the same time. is there a way to stop this?” the answer is NO, you can’t. If a pending order is triggered and hits the SL, the other order may also be triggered on the same bar, as all pending orders that haven’t been triggered are only cancelled when a bar closes.

     

    #248892

    Thank you Roberto for your kind help.

    kinda makes sense now. I will still keep the time range, as I like to work with different time ranges. I really appreciate your help and sharing of knowledge!

    1 user thanked author for this post.
Viewing 5 posts - 16 through 20 (of 20 total)

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