I want to add some code to a custom indicator that will continue to color bars the same color after the first condition (Condition1) occurs until a new condition (Condition2) occurs. I’m trying to figure out how I need to set up Condition1 and Condition2 since it needs to replicate the condition of the previous bar and apply the same color. Do I need to create a method for these or is it something else?
Input variables declared:
Entry1_sl
Entry1_slx
Condition1 = Close[0] < Close[Entry1_sl] and Close[0] > Close [Entry1_slx]
Condition2 = Close[0] > Close[Entry1_sl] and Close[0] < Close [Entry1_slx]
If Condition1 = False and Condition2 = False then
Condition1 = Condition1[1]
If Condition1 = False and Condition2 = False then
Condition2 = Condition2[1]
Thanks,
Ben
Comment