Milwaukee, WI
Posts: 88 since Jan 2014
Thanks Given: 4
Thanks Received: 47
|
Start with these assumptions:
Your chart is on ES.
The ticker symbol for YM is, say, "YMM17" or something like that.
I assume you know how to make a basic indicator in Amibroker.
I chose exponential moving average for this example.
Here is the code:
per = param("period length", 21, 5, 100, 1); // set up an adjustable parameter for your ema period
ym_close = Foreign( "YMM17", "Close" ) ; // bring in the close of a foreign ticker
ym_ema = ema(ym_close, per); // create an exponential moving average of YM
ym_es_ratio = ym_ema/ema(close, per); // create the ratio of the YM and ES ema's
Plot(ym_es_ratio, _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); // plot the indicator
You may want to join the amibroker yahoo group. Those members are experts in amibroker code writing.
|