@generic and @BenTen One more question plz, I want the arrows to show only on 15min time frame how can I do that? The current script i came up with shows arrows on 15min, 5 min and on 1 min, but does show on higher than 15 min time frames so i am missing something but i don't know what... i tried to add IF..ELSE as u can see in my code but i don't know what veriabe would go after else lol
thank you both
thank you both
Code:
def fifteen_min_bool;
# Set Chart for 15mm
if GetAggregationPeriod() == AggregationPeriod.FIFTEEN_MIN {
fifteen_min_bool = 1;
} else {
fifteen_min_bool = 0;
}
#def ltDay = if GetAggregationPeriod() == AggregationPeriod.fifteen_min then 1 else Double.NaN;
input length = 20;
input trendSetup = 3;
def BodyMax = Max(open, close);
def BodyMin = Min(open, close);
def IsEngulfing = BodyMax > BodyMax[1] and BodyMin < BodyMin[1];
def IsWhite = open < close;
def IsBlack = open > close;
def IsPrevDoji = IsDoji(length)[1];
#if GetAggregationPeriod() <= AggregationPeriod.fifteen_min {
plot Bearish_15 = IsAscending(close(period = AggregationPeriod.FIFTEEN_MIN), trendSetup)[1] and
(IsWhite[1] or IsPrevDoji) and
IsBlack and
IsEngulfing;
plot Bullish_15 = IsDescending(close(period = AggregationPeriod.FIFTEEN_MIN), trendSetup)[1] and
(IsBlack[1] or IsPrevDoji) and
IsWhite and
IsEngulfing;
Bearish_15.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Bearish_15.SetDefaultColor(GetColor(1));
Bearish_15.SetLineWeight(2);
Bullish_15.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
Bullish_15.SetDefaultColor(GetColor(2));
Bullish_15.SetLineWeight(2);
#} else {#}