Scalability issues

trash

Well-Known Member
#11
Trash Sir

Didnt get, what you explained to do.
Please do not get angry. We are not as expert as you, May be one day.
If you have explained it previously in any other thread, then please post link. Otherwise, please explain in some detail.

Thanks
I'm not angry and wasn't angry. It's just amazing that people are so helpless if they do not get spoon-fed from start to finish. SetForeign() is already mentioned two times in this thread.

You should not use Foreign if there are multiple foreign arrays to be calculated and output. It's clearly mentioned that SetForeign() is multiple times faster than calling multiple time Foreign(). You just have to read it in the AmiBroker help.

Anyway this is a simplified version of the picture in posting #3 without foreign title

Code:
_SECTION_BEGIN( "Default Symbol" );
// by trash
// http://www.traderji.com/amibroker/86476-scalability-issues-2.html#post978411
GraphXSpace = Param( "Stretch/Compress", 5, -50, 100, 1 );// or use Shift + left mouse on the y-axis
Color1      = ParamColor( "Default Symbol - Color", colorGrey50 );
style1      = ParamStyle( "Default Symbol - Style", styleBar| styleNoTitle, maskAll );

SetChartOptions( 0, chartShowArrows | chartShowDates | chartWrapTitle );
_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, style1 );
Plot( MA( C, 50 ), "MA", Color1, styleLine );
Plot( BBandTop( C, 20, 2 ), "BBTop", Color1, styleLine ); 
Plot( BBandBot( C, 20, 2 ), "BBBot", Color1, styleLine ); 
_SECTION_END();

_SECTION_BEGIN( "Foreign Symbol" );
// by trash
// http://www.traderji.com/amibroker/86476-scalability-issues-2.html#post978411
EnableTextOutput( False );

ticker2     = ParamStr( "Foreign Symbol1", "INPUT HERE" );
color2      = ParamColor( "Foreign Symbol1 - Color", colorOrange );
style2      = ParamStyle( "Foreign Symbol1 - Style", styleBar | styleLeftAxisScale, maskAll );
styleindi   = styleLine | styleLeftAxisScale;

if ( ticker2 == "INPUT HERE" || ticker2 == "" )
    style2  = styleindi = styleNoDraw | styleNoTitle;

SetForeign( ticker2 );
	Plot( C, "\n" + ticker2, Color2, style2 );
	// add other calculations/plots here
	Plot( MA( C, 50 ), "\nMA foreign", color2, styleindi );
	Plot( BBandTop( C, 20, 2 ), "\nBBTop foreign", Color2, styleindi ); 
	Plot( BBandBot( C, 20, 2 ), "\nBBBot foreign", Color2, styleindi ); 
RestorePriceArrays();

EnableTextOutput( True );
_SECTION_END();
 
Last edited:
#12
In Ami.. under Basic chart you should have Price (Foreign) option. You can overlay this on the basic price chart. Then go to param you will have option to put a diff script.
Sorry Manish
I was not looking for this function. I know about price (foreign) and I am using it, but in two panes, and not overlaying in the same pane, as it compressed the chart too much, when there is wide difference in prices.

But thanks for your reply.
 
#13
I'm not angry and wasn't angry. It's just amazing that people are so helpless if they do not get spoon-fed from start to finish. SetForeign() is already mentioned two times in this thread.

You should not use Foreign if there are multiple foreign arrays to be calculated and output. It's clearly mentioned that SetForeign() is multiple times faster than calling multiple time Foreign(). You just have to read it in the AmiBroker help.

Anyway this is a simplified version of the picture in posting #3 without foreign title
Thanks Trash Sir
Pleased to know that your are not angry. :)

But sorry, I am not looking for this one.
I am looking for "apply multiple symbols in chart sheets" That MT4 type chart one. The last chart in post 2.

Please provide the procedure for the same.

Thanks
 

trash

Well-Known Member
#14
SetForeign!

Now the forth time being mentioned

SetForeign, SetForeign, SetForeign, .....
5th, 6th, 7th, .....

In Parameters (CTRL+R) you enter your symbol name.
You can rename each Sheet tab to custom name.

Basic Foreign Price chart below. It is just the same as standard plot. And as usual you drag and drop your indicator onto it.

To be honest I don't understand what is so difficult to understand about one small single line called SetForeign. (8th time now mentioned besides that)

Code:
// by trash
// http://www.traderji.com/amibroker/86476-scalability-issues-2.html#post978411
EnableTextOutput( False );

Ticker     = ParamStr( "Foreign Symbol", Name() );
Color      = ParamColor( "Foreign Symbol - Color", colorLightGrey );
style      = ParamStyle( "Foreign Symbol - Style", styleBar, maskAll );
styleindi  = ParamStyle( "Foreign Indicator - Style", styleLine );
width      = -20;   

// Start of Foreign calculation #####################################################
SetForeign( Ticker, True, True );

SetChartOptions( 0, chartShowArrows | chartShowDates | chartWrapTitle );

_N( Title = StrFormat( Ticker + " - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.2f%%) {{VALUES}}",
                       O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) ); 
                 
Plot( C, "", Color, style, Null, Null, 0, 0, width );

// add other calculations/plots here
Plot( MA( C, 50 ), "MA", colorRed, styleindi, Null, Null, 0, 0, width );
Plot( BBandTop( C, 20, 2 ), "BBTop", ColorAqua, styleindi, Null, Null, 0, 0, width );
Plot( BBandBot( C, 20, 2 ), "BBBot", ColorAqua, styleindi, Null, Null, 0, 0, width );

// RestorePriceArrays(); // end of Foreign
 
Last edited:
#15
Sorry, I am not able to put 4 symbols in the code to compare! Can you help me?
Also, I compared in investing sp500 and stoxx50 and it does so in percentage and the graph is different. I show it in weekly. regards
The code it´s ...... but I cannot compare 4 tickeres
_SECTION_BEGIN( "Default Symbol" );
// by trash
// http://www.traderji.com/amibroker/86476-scalability-issues-2.html#post978411
GraphXSpace = Param( "Stretch/Compress", 5, -50, 100, 1 );// or use Shift + left mouse on the y-axis
Color1 = ParamColor( "Default Symbol - Color", colorGrey50 );
style1 = ParamStyle( "Default Symbol - Styleline", styleLine| styleNoTitle, maskAll );

SetChartOptions( 0, chartShowArrows | chartShowDates | chartWrapTitle );
_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, style1 );
//Plot( MA( C, 50 ), "MA", Color1, styleLine );
//Plot( BBandTop( C, 20, 2 ), "BBTop", Color1, styleLine );
//Plot( BBandBot( C, 20, 2 ), "BBBot", Color1, styleLine );
_SECTION_END();

_SECTION_BEGIN( "Foreign Symbol" );
// by trash
// http://www.traderji.com/amibroker/86476-scalability-issues-2.html#post978411
EnableTextOutput( False );

ticker2 = ParamStr( "Foreign Symbol1", "INPUT HERE" );
color2 = ParamColor( "Foreign Symbol1 - Color", colorOrange );
style2 = ParamStyle( "Foreign Symbol1 - Styleline", styleLine | styleLeftAxisScale, maskAll );
styleindi = styleLine | styleLeftAxisScale;

if ( ticker2 == "INPUT HERE" || ticker2 == "" )
style2 = styleindi = styleNoDraw | styleNoTitle;

SetForeign( ticker2 );
Plot( C, "\n" + ticker2, Color2, style2 );
// add other calculations/plots here
//Plot( MA( C, 50 ), "\nMA foreign", color2, styleindi );
//Plot( BBandTop( C, 20, 2 ), "\nBBTop foreign", Color2, styleindi );
//Plot( BBandBot( C, 20, 2 ), "\nBBBot foreign", Color2, styleindi );
RestorePriceArrays();

EnableTextOutput( True );
_SECTION_END();


// by trash
// http://www.traderji.com/amibroker/86476-scalability-issues-2.html#post978411
EnableTextOutput( False );

Ticker = ParamStr( "Foreign Symbol", Name() );
Color = ParamColor( "Foreign Symbol - Color", colorLightGrey );
style = ParamStyle( "Foreign Symbol - Style", styleBar, maskAll );
styleindi = ParamStyle( "Foreign Indicator - Style", styleLine );
width = -20;

// Start of Foreign calculation #####################################################
SetForeign( Ticker, True, True );

SetChartOptions( 0, chartShowArrows | chartShowDates | chartWrapTitle );

_N( Title = StrFormat( Ticker + " - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.2f%%) {{VALUES}}",
O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) );

Plot( C, "", Color, style, Null, Null, 0, 0, width );
 

Attachments

Similar threads