|
joshsmi 發表於 12-11-3 02:06
keithlsp, use Setforeign() or Foreign()
This code displays 3 tickers in the same pane.
One correction to my codes. PlotForeign is not needed if using SetForeign.
So here are the updates:
- GraphXSpace = Param( "GraphXSpace", 5, -50, 100, 1 );
- color1 = ParamColor( "Color 1", colorGrey50 );
- //2nd ticker
- color2 = ParamColor( "Color 2", colorOrange );
- Ticker2 = ParamStr( "Symbol 2", Name() );
- //3rd ticker
- color3 = ParamColor( "Color 3", colorYellow );
- Ticker3 = ParamStr( "Symbol 3", Name() );
- SetChartOptions( 0, chartShowArrows | chartShowDates );
- _N( Title = StrFormat( EncodeColor( Color1 ) + "{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}} ", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) );
- Plot( C, "", Color1, styleNoTitle | ParamStyle( "Style 1" ) | GetPriceStyle() );
- // 2nd ticker
- SetForeign( Ticker2 );
- Plot( C, "\n" + ticker2 , Color2 , ParamStyle( "Style 2", styleCandle, maskAll ) | styleOwnScale );
- RestorePriceArrays();
- // 3rd ticker
- SetForeign( Ticker3 );
- Plot( C, "\n" + ticker3 , Color3 , ParamStyle( "Style 3", styleCandle, maskAll ) | styleOwnScale );
- RestorePriceArrays();
複製代碼
- GraphXSpace = Param( "GraphXSpace", 5, -50, 100, 1 );
- //2nd ticker
- Ticker2 = ParamStr( "Symbol 2", Name() );
- color2 = ParamColor( "Color Ticker 2", colorBlack );
- // 2nd ticker
- SetForeign( Ticker2 );
- SetChartOptions( 0, chartShowArrows | chartShowDates );
- _N( Title = StrFormat( EncodeColor( Color2 ) + Ticker2 + " - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}} ", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) );
- Plot( C , "" , Color2 , ParamStyle( "Style" ) | GetPriceStyle() );
複製代碼
|
|