SetChartBkColor(colorBlack);
SetChartOptions( 2,chartShowArrows+ chartShowDates | chartWrapTitle );
Layer = Param("Layer", 0, -5, 5, 1) ;
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} " + EncodeColor( colorGreen ) + " Open %g," + EncodeColor( colorBlue ) + " Hi %g, " + EncodeColor( colorRed ) + " Lo %g, " + EncodeColor( colorBlue ) + " Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
HiVolume = IIf(V > (2 * MA(V,10)), True, False);
PlotShapes(shapeSmallCircle * HiVolume, IIf(C > O, colorRed, colorWhite), 0, (O+C)/2, 0);
ToolTip = "Open = " + O + "\nHigh = " + H + "\nLow = " + L + "\nClose = " + C ;
Plot( C, "Close", colorTeal, styleNoTitle | styleCandle,0,0,0,Layer );
TimeFrameSet(inHourly);
green = C>O;
prevgreen = Ref(green,-1)==1;
TimeFrameRestore();
greenexp = TimeFrameExpand(prevgreen,inHourly);
PlotShapes(IIf(greenexp,shapeUpArrow,shapeNone),colorGreen,0,L,-35);
SetChartBkColor(colorBlack);
SetChartOptions( 2,chartShowArrows+ chartShowDates | chartWrapTitle );
Layer = Param("Layer", 0, -5, 5, 1) ;
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} " + EncodeColor( colorGreen ) + " Open %g," + EncodeColor( colorBlue ) + " Hi %g, " + EncodeColor( colorRed ) + " Lo %g, " + EncodeColor( colorBlue ) + " Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
HiVolume = IIf(V > (2 * MA(V,10)), True, False);
PlotShapes(shapeSmallCircle * HiVolume, IIf(C > O, colorRed, colorWhite), 0, (O+C)/2, 0);
ToolTip = "Open = " + O + "\nHigh = " + H + "\nLow = " + L + "\nClose = " + C ;
Plot( C, "Close", colorTeal, styleNoTitle | styleCandle,0,0,0,Layer );
TimeFrameSet(inHourly);
green = C>O;
prevgreen = Ref(green,-1)==1;
TimeFrameRestore();
greenexp = TimeFrameExpand(prevgreen,inHourly);
PlotShapes(IIf(greenexp,shapeUpArrow,shapeNone),colorGreen,0,L,-35);
/// applied on 30 minute
TimeframeSet( inHourly );
Bar60 = C > O;
TimeframeRestore();
expandmode = expandPoint;
Bar60 = Ref( TimeFrameExpand( Bar60, inHourly, expandmode ), -1);
Bar30 = C>O;
Plot( C, "", colorDefault, styleCandle ); // Just to show on pane
PlotShapes( IIF( Bar30 AND Bar60, shapeUpArrow , shapeNone ), colorAqua );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} - {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%), Vol %g {{VALUES}}",
O, H, L, C, SelectedValue( ROC( C, 1 ) ), V ) );
/// applied on 60 minute
Plot( C, "", colorDefault, styleCandle ); // Just to show on pane
PlotShapes( IIF( C>O, shapeUpArrow , shapeNone ), colorAqua );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} - {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%), Vol %g {{VALUES}}",
O, H, L, C, SelectedValue( ROC( C, 1 ) ), V ) );
bar30 ==1 AND bar60 ==1
bar30 AND bar60
/// applied on 30 minute
TimeframeSet( inHourly );
Bar60 = C > O;
TimeframeRestore();
expandmode = expandPoint;
Bar60 = Ref( TimeFrameExpand( Bar60, inHourly, expandmode ), -1);
Bar30 = C>O;
Plot( C, "", colorDefault, styleCandle ); // Just to show on pane
PlotShapes( IIF( Bar30 AND Bar60, shapeUpArrow , shapeNone ), colorAqua );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} - {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%), Vol %g {{VALUES}}",
O, H, L, C, SelectedValue( ROC( C, 1 ) ), V ) );
/// applied on 60 minute
Plot( C, "", colorDefault, styleCandle ); // Just to show on pane
PlotShapes( IIF( C>O, shapeUpArrow , shapeNone ), colorAqua );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} - {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%), Vol %g {{VALUES}}",
O, H, L, C, SelectedValue( ROC( C, 1 ) ), V ) );
bar30 ==1 AND bar60 ==1
bar30 AND bar60
/// @link http://www.traderji.com/software/101822-need-your-help-multitimeframe-2.html#post1157240
Plot( C, "", colorDefault, styleCandle ); // Just to show on pane
if( Interval() < 3600 ) {
TimeframeSet( inHourly );
Bar60 = C > O;
TimeframeRestore();
expandmode = expandPoint;
Bar60 = Ref( TimeFrameExpand( Bar60, inHourly, expandmode ), -1);
} else
Bar60 = C>O;
PlotShapes( IIF( Bar60, shapeUpArrow , shapeNone ), colorAqua );
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} - {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%), Vol %g {{VALUES}}",
O, H, L, C, SelectedValue( ROC( C, 1 ) ), V ) );