Hi Traders, Happy MDW too all
I wanted to create a simple study to plot an arrow when there is a 20x50ema crossover from a one minute chart agg period, while viewing my standard 5min chart. I typically just trade $PY on a 5min chart, but have found very trade-able signals (typically reversals) from the 20/50 crossover from one minute time period.
Just want to make sure my logic is sound.. Is it possible to be viewing one particular time frame, but referencing other agg periods and display the results?
Here's the code I've sliced together thus far, but its only displaying the crossover from the 5min chart, or whatever time period I select to view in TOS. Hope Im explaining myself ok, appreciate any help. Cheers
###
declare upper;
INPUT AGGREGATIONPERIOD = AGGREGATIONPERIOD.one_min; ??
input ema1_len = 20;
input ema2_len = 50;
input averageType = AverageType.EXPONENTIAL;
def ema1 = MovAvgExponential(length=ema1_len);
def ema2 = MovAvgExponential(length=ema2_len);
def bull_cross = ema1 crosses above ema2;
def bear_cross = ema1 crosses below ema2;
plot ArrowUp = bull_cross;
plot ArrowDn = bear_cross;
ArrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
ArrowUp.SetDefaultColor(Color.GREEN);
ArrowDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
ArrowDn.SetDefaultColor(Color.RED);
I wanted to create a simple study to plot an arrow when there is a 20x50ema crossover from a one minute chart agg period, while viewing my standard 5min chart. I typically just trade $PY on a 5min chart, but have found very trade-able signals (typically reversals) from the 20/50 crossover from one minute time period.
Just want to make sure my logic is sound.. Is it possible to be viewing one particular time frame, but referencing other agg periods and display the results?
Here's the code I've sliced together thus far, but its only displaying the crossover from the 5min chart, or whatever time period I select to view in TOS. Hope Im explaining myself ok, appreciate any help. Cheers
###
declare upper;
INPUT AGGREGATIONPERIOD = AGGREGATIONPERIOD.one_min; ??
input ema1_len = 20;
input ema2_len = 50;
input averageType = AverageType.EXPONENTIAL;
def ema1 = MovAvgExponential(length=ema1_len);
def ema2 = MovAvgExponential(length=ema2_len);
def bull_cross = ema1 crosses above ema2;
def bear_cross = ema1 crosses below ema2;
plot ArrowUp = bull_cross;
plot ArrowDn = bear_cross;
ArrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
ArrowUp.SetDefaultColor(Color.GREEN);
ArrowDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
ArrowDn.SetDefaultColor(Color.RED);