Do until function

Viewing 9 posts - 1 through 9 (of 9 total)
  • #100655

    Hi,

    I’ve been checking for a setup in my chart, and color the background once it happens. It looks like this :

    So if LA or SA = true, the background color switch to red or green and if LA or SA = false, it switch back to the standard back groundcolor. This works as expected.

    The question I have is :

    Once LA or SA is true, i also want to check for another condition, but i don’t no how to build it.

    Something like this

    LA = A and B and C and D

    If LA then

    backgroundcolor (green) until (A or B or Z)

    So once LA is true and the background is changed to green, i want to check for also other conditions, so if one of these extra conditions is false, i need to flip the background again to the standard color.

    Can someone advice me here. Many thanks.

    #100657

    >> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<

    #100658

    You can add, ar line 3, CondA = …..

    then, at line 8 IF LA AND CondA….

    #100659

    Thank you for your feedback.

    But if i adjusted like that then the background ONLY will change when BOTH conditions are true (LA and CondA).

    I want that the background changes with LA = true and stays green until one of the conditions in CondA fails.

    #100662

    Try to use a single BACKGROUNDCOLOR instruction with 3 variables R,G,B that change depending of your conditions.

    #100678

    Something like this :

    If the conditions of LA are true, the background will be changed to green, until one of the conditions of CondLA are met, then the background will revert to the standard background.

    Only the syntax is wrong 🙁

     

    #100681

    WEND is missing.

    The last line of an indicator must be RETURN.

    #100690

     

    So if All the conditions (RSI, DSS, Slow, Quick) of “LA” are true, the background will be set to green

    Until 1/4 (Slow, DSS, RSI, MA47)  conditions of “CondLA” will be set to true, the loop will be entered and revert the background to the standard color.

    But what about the loop ? after the background is reverted to the standard color, the loop will never exit until all the conditions are false (Slow, DSS, RSI, MA47) again.

    I just want to revert to standard background if 1/4 conditions is true and then leave the loop. Any ideas ?

    #100755

    Sorry i’m late in the discussion, but why not simply just do that: (not tested)

     

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

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