I am someone that struggles with coding and am hoping there is an easy fix to my coding shortcomings.
I want a script that highlights the two candle that form what I refer to as equilibrium. Equilibrium for this example being when an up candle close and the very next down candle's open are exactly the same or when a down candle's close and the very next candle is a down candle's open are exactly the same.
Here's my current code: (almost exclusively used from halcyonguy's script in the post https://usethinkscript.com/threads/...g-inside-candle-formations.15820/#post-127558 (I hope my use of halcyonguy's script doesn't create offense. I found the thread to be incredibly interesting and helpful.)
#Candle Equilibrium
def bn = BarNumber();
def na = Double.NaN;
def o = open;
def h = high;
def l = low;
def c = close;
def barup = (c > o);
def bardwn = (c < o);
def equilibrium = open==close[1];
AssignPriceColor(if equilibrium
then color.light_orange
else color.current);
I have attached a chart for a better visual example.
Any assistance with this would be greatly appreciated.
I want a script that highlights the two candle that form what I refer to as equilibrium. Equilibrium for this example being when an up candle close and the very next down candle's open are exactly the same or when a down candle's close and the very next candle is a down candle's open are exactly the same.
Here's my current code: (almost exclusively used from halcyonguy's script in the post https://usethinkscript.com/threads/...g-inside-candle-formations.15820/#post-127558 (I hope my use of halcyonguy's script doesn't create offense. I found the thread to be incredibly interesting and helpful.)
#Candle Equilibrium
def bn = BarNumber();
def na = Double.NaN;
def o = open;
def h = high;
def l = low;
def c = close;
def barup = (c > o);
def bardwn = (c < o);
def equilibrium = open==close[1];
AssignPriceColor(if equilibrium
then color.light_orange
else color.current);
I have attached a chart for a better visual example.
Any assistance with this would be greatly appreciated.
Last edited: