If and While structure

Forums ProRealTime English forum ProBuilder support If and While structure

Viewing 8 posts - 1 through 8 (of 8 total)
  • #55213

    Dear All

    I want to code as when 2 of my conditions met then waiting for another condition to be happened to enter short and if c1 happened exit loop. please confirm below code will do what i need. with thanks. 

     

    #55219

    A strategy with this code will either never enter the WHILE loop if C6 is false or never exit that loop if C6 is true, since C6 and C1 are not modified once you are within the loop.

    Roberto

    1 user thanked author for this post.
    #55440

    can you pls guide me a code that , if c1 happened wait for c2 to happen then enter market and if c3 happened cancel the first if confirmation and exit the loop?

    with thanks. 

    #55443

    by the way, c1 will not persist. is a crossover

    #55452

    Please post here the complete code of the strategy, not so easy to understand what you want to be coded 🙂 

     

    #55483

    NEED TO BE COMPLETED. WHEN C1 HAPPEN WAIT UNTIL C2 HAPPEN WHEN C3 ALSO PERSISTS TO ENTER MARKET

    #55492

    Ok Pedi’s! Let’s try with this code. 🙂 

    You need first to store the fact that C1 has crossed, and there are 2 ways to know it has, first one is a test through the last X bars:

    or you can store the variable like this (but you’ll need to reset it to 0 when another trigger, but it depends on your strategy… so I do not when you’d like to reset the C1 has crossed)

    Now that you know your c1 condition is true, let’s check the other conditions and put an order at market:

     

    1 user thanked author for this post.
    #55511

     Thanks for clarifying advice, Nicolas. 

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

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