input indicator = { T1, T2, default T3, T4, T5, T6 };
input price = close;
input period = 15;
input volumeFactor = 0.70;
input displace = 0;
input sign = { plus, default minus };
input Label = Yes;
input paintbars = Yes;
input aggregation1 = AggregationPeriod.MIN;
input aggregation2 = AggregationPeriod.FIVE_MIN;
def t1_price_01 = close(period = aggregation1);
def t1_ema_01 = ExpAverage( t1_price_01, period );
def t1_gd_01 = ( t1_ema_01 * ( 1 + volumeFactor ) ) - ( ExpAverage( t1_ema_01, period ) * volumeFactor );
def t2_price_01 = t1_gd_01;
def t2_ema_01 = ExpAverage( t2_price_01, period );
def t2_gd_01 = ( t2_ema_01 * ( 1 + volumeFactor ) ) - ( ExpAverage( t2_ema_01, period ) * volumeFactor );
def t3_price_01 = t2_gd_01;
def t3_ema_01 = ExpAverage( t3_price_01, period );
def t3_gd_01 = ( t3_ema_01 * ( 1 + volumeFactor ) ) - ( ExpAverage( t3_ema_01, period ) * volumeFactor );
def T4_price_01 = t3_gd_01;
def T4_ema_01 = ExpAverage( T4_price_01, period );
def T4_gd_01 = ( T4_ema_01 * ( 1 + volumeFactor ) ) - ( ExpAverage( T4_ema_01, period ) * volumeFactor );
def T5_price_01 = T4_gd_01;
def T5_ema_01 = ExpAverage( T5_price_01, period );
def T5_gd_01 = ( T5_ema_01 * ( 1 + volumeFactor ) ) - ( ExpAverage( T5_ema_01, period ) * volumeFactor );
def T6_price_01 = T5_gd_01;
def T6_ema_01 = ExpAverage( T6_price_01, period );
def T6_gd_01 = ( T6_ema_01 * ( 1 + volumeFactor ) ) - ( ExpAverage( T6_ema_01, period ) * volumeFactor );
plot T3_01;
switch( indicator ) {
case T1:
T3_01 = t1_gd_01;
case T2:
T3_01 = t2_gd_01;
case T3:
T3_01 = t3_gd_01;
case T4:
T3_01 = t4_gd_01;
case T5:
T3_01 = t5_gd_01;
case T6:
T3_01 = t6_gd_01;
}
T3_01.AssignValueColor(if T3_01 > T3_01[1] then Color.GREEN else Color.RED);
T3_01.HideBubble();
AddLabel(Label, if T3_01 > T3_01[1] then " A " else " A ", if T3_01 > T3_01[1] then Color.GREEN else Color.RED);
assignPriceColor(if paintbars and T3_01 < T3_01[1] then color.DARK_RED else if paintbars and T3_01 > T3_01[1] then color.DARK_GREEN else color.CURRENT);
def t1_price_02 = close(period = aggregation2);
def t1_ema_02 = ExpAverage( t1_price_02, period );
def t1_gd_02 = ( t1_ema_02 * ( 1 + volumeFactor ) ) - ( ExpAverage( t1_ema_02, period ) * volumeFactor );
def t2_price_02 = t1_gd_02;
def t2_ema_02 = ExpAverage( t2_price_02, period );
def t2_gd_02 = ( t2_ema_02 * ( 1 + volumeFactor ) ) - ( ExpAverage( t2_ema_02, period ) * volumeFactor );
def t3_price_02 = t2_gd_02;
def t3_ema_02 = ExpAverage( t3_price_02, period );
def t3_gd_02 = ( t3_ema_02 * ( 1 + volumeFactor ) ) - ( ExpAverage( t3_ema_02, period ) * volumeFactor );
def T4_price_02 = t3_gd_02;
def T4_ema_02 = ExpAverage( T4_price_02, period );
def T4_gd_02 = ( T4_ema_02 * ( 1 + volumeFactor ) ) - ( ExpAverage( T4_ema_02, period ) * volumeFactor );
def T5_price_02 = T4_gd_02;
def T5_ema_02 = ExpAverage( T5_price_02, period );
def T5_gd_02 = ( T5_ema_02 * ( 1 + volumeFactor ) ) - ( ExpAverage( T5_ema_02, period ) * volumeFactor );
def T6_price_02 = T5_gd_02;
def T6_ema_02 = ExpAverage( T6_price_02, period );
def T6_gd_02 = ( T6_ema_02 * ( 1 + volumeFactor ) ) - ( ExpAverage( T6_ema_02, period ) * volumeFactor );
plot T3_02;
switch( indicator ) {
case T1:
T3_02 = t1_gd_02;
case T2:
T3_02 = t2_gd_02;
case T3:
T3_02 = t3_gd_02;
case T4:
T3_02 = t4_gd_02;
case T5:
T3_02 = t5_gd_02;
case T6:
T3_02 = t6_gd_02;
}
T3_02.AssignValueColor(if T3_02 > T3_02[1] then Color.GREEN else Color.RED);
T3_02.setLineWeight(2);
T3_02.HideBubble();
AddLabel(Label, if T3_02 > T3_02[1] then " B " else " B ", if T3_02 > T3_02[1] then Color.GREEN else Color.RED);