Break For with Past condition

Forums ProRealTime English forum ProBuilder support Break For with Past condition

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

    Hi all,

    I’am using a For loop to detecting a cross over, but how to include in the condition to get the first result only if the ema1 > ema2 from 0 to X ? I tried many soltuion but I still very bad and very old to find a solution 🙂

     

    tks in advance to any help, all idea is welcome

    #190177

    Try this as line 7:

    1 user thanked author for this post.
    #190201

    Try this as line 7:

    Hi Roberto and tks for your answers, I know your answer, because I made the code quikly yesterday ans so tyred, So your answer is very right, but I need also check all the condition like ema1[X] > ema2[X], I mean befaore finding the

    I found this solution I think from Nicola here, but I think it’s wrong, but It will help me to find my way

    #190208

    Can you explain exactly what are the two conditions to be detected and in which order?

     

    1 user thanked author for this post.
    #190209

    that is an other code :

    I want to check from 0 to 15 :
    – Sma > Lma
    – get the barindex of last Lma Crosses Over Sma
    – and color with Green when my Lma > Sma

    the Idea of coloring the backgrown it’s just to know when my condition is true, the idea is to use this condition like an On Off button, so if my condition is On I will do other think but if my condititon go from On to Off so I don’t do anythink,
    I put a photo, in the red cercle I can’t detect my condition because my Varaiable value is 16, so I think I have to use a first Break to get the variable value and after do a continue and do an other break, I’m not sure about programming

    tks in advance

    #190318

    It’s an inner feature of the iteration FOR…NEXT, the counter is first incremented, then the iteration ends when that number is greater than the one betweeen TO and DO. You can ALWAYS subtract 1, unless it is exited with BREAK, as in this case the iteration is exited BEFORE the the counter is incremented. To accomplish that you need to use a variable to be assigned 1 when the counter needs to be drecremented and 0 when it does not (not tested):

    1 user thanked author for this post.
    #190327

    tks you so much Roberto, I find an other way to resolve my other problem and I understand and don’t understand in the same time your solution because I’m too old :-), again tks you so much to your answers it’s seems working just a small problem with drawing many ellipse, I will try again to understand your idea and come back to this thread, again tks you

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