@Trading51 This part of the code sets an agg period of 20 minutes. Any chart time frame over 20 minutes will stop the study from working. Several choices.
Erase or comment out this part of the study.
Change Def agg to the an agg period higher then chart time period.
Change this line " def agg = AggregationPeriod.TWENTY_MIN; " to "input agg = AggregationPeriod.TWENTY_MIN;"
That should let you choose an agg in settings.
# Black Dog Arrows------------------------------------------------------
# Change Aggregation Period to 20 minutes------------------------
def agg = AggregationPeriod.TWENTY_MIN;
def data = close(period = agg);
# 2 EMAs of Black Dogs--------------------------------------------------
def BDfastEMA=ExpAverage(DATA,20);
def BDslowEMA=ExpAverage(DATA,100);
# Black Dog UP for EMA20 crossing ABOVE EMA100-------------
def UpCross = if BDfastEMA > BDslowEma AND BDfastEMA[1] < BDslowEMA then 1 else 0;
Plot BDup = if UpCross then high else double.nan;
BDup.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
BDup.SetLineWeight(5);
BDup.SetDefaultColor(color.WHITE);
BDup.HideBubble();
BDup.HideTitle();
# Black Dog DN for EMA20 crossing BELOW EMA100-----------
def DnCross = if BDfastEMA < BDslowEma AND BDfastEMA[1] > BDslowEMA then 1 else 0;
Plot BDdn = if DnCross then low else double.nan;
BDdn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
BDdn.SetLineWeight(5);
BDdn.SetDefaultColor(color.WHITE);
BDdn.HideBubble();
BDdn.HideTitle();
# END==========================================