Evening,
I've developed a Target Condition that involves coding a new ThinkScript indicator. My target is to have a visual signal (green arrow) populate on my TOS screen when a set of OHLC conditions/calculations are met. Think "ADX Wilders" for very basic calculations.
I call the signal "thrust," and it compares the OHLC characteristics of a 15m bar to "yesterday's close."
The goal is that when the "thrust" of a 15m bar is greater than 33%, a green arrow (or some other very noticeable visual management signal) will populate the TOS price graph.
In excel, the calculation reads as follows:
((15m close - 15m open) / 15m open) / ((15m close - Yesterday's Close) / Yesterday's Close)) = Thrust
More or less, how much of the %gain is the current bar responsible for?
When this calculation yields >33%, poof, green arrow.
I've made some ground by borrowing code, but the output isn't producing a visual signal on appropriate bars.
Here's where I'm at thus far:
For reference, on 8/1/2022, TXMD should populate a green arrow under the very first 15m bar of the day.
___________________________________________________________________________________________________
def RTHPriorClose = if GetTime() crosses above RegularTradingEnd(GetYYYYMMDD())
then close[1]
else RTHPriorClose[1];
def Thrust = (((close - open) / open) / ((close - RTHPriorClose) / RTHPriorClose);
input crossingType = {default above, below};
#input threshold = 20;
#input averageType = AverageType.WILDERS;
#input length = 1;
#ADX Wilders#
plot signal = (Thrust) >=.33;
signal.DefineColor("Above", GetColor(0));
signal.DefineColor("Below", GetColor(1));
signal.AssignValueColor(if crossingType == CrossingType.above then signal.color("Above") else signal.color("Below"));
signal.SetPaintingStrategy(if crossingType == CrossingType.above
then PaintingStrategy.BOOLEAN_ARROW_UP
else PaintingStrategy.BOOLEAN_ARROW_DOWN);
I've developed a Target Condition that involves coding a new ThinkScript indicator. My target is to have a visual signal (green arrow) populate on my TOS screen when a set of OHLC conditions/calculations are met. Think "ADX Wilders" for very basic calculations.
I call the signal "thrust," and it compares the OHLC characteristics of a 15m bar to "yesterday's close."
The goal is that when the "thrust" of a 15m bar is greater than 33%, a green arrow (or some other very noticeable visual management signal) will populate the TOS price graph.
In excel, the calculation reads as follows:
((15m close - 15m open) / 15m open) / ((15m close - Yesterday's Close) / Yesterday's Close)) = Thrust
More or less, how much of the %gain is the current bar responsible for?
When this calculation yields >33%, poof, green arrow.
I've made some ground by borrowing code, but the output isn't producing a visual signal on appropriate bars.
Here's where I'm at thus far:
For reference, on 8/1/2022, TXMD should populate a green arrow under the very first 15m bar of the day.
___________________________________________________________________________________________________
def RTHPriorClose = if GetTime() crosses above RegularTradingEnd(GetYYYYMMDD())
then close[1]
else RTHPriorClose[1];
def Thrust = (((close - open) / open) / ((close - RTHPriorClose) / RTHPriorClose);
input crossingType = {default above, below};
#input threshold = 20;
#input averageType = AverageType.WILDERS;
#input length = 1;
#ADX Wilders#
plot signal = (Thrust) >=.33;
signal.DefineColor("Above", GetColor(0));
signal.DefineColor("Below", GetColor(1));
signal.AssignValueColor(if crossingType == CrossingType.above then signal.color("Above") else signal.color("Below"));
signal.SetPaintingStrategy(if crossingType == CrossingType.above
then PaintingStrategy.BOOLEAN_ARROW_UP
else PaintingStrategy.BOOLEAN_ARROW_DOWN);