NexusFi: Find Your Edge


Home Menu

 





Ratio


Discussion in Platforms and Indicators

Updated
    1. trending_up 1,583 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 datahogg 
Knoxville Tennessee USA
 
Experience: Intermediate
Platform: TOS
Trading: ES, NQ, CL, /6E futures options.
Posts: 346 since Oct 2012
Thanks Given: 135
Thanks Received: 154

Using AmiBroker would it be possible to plot the following function:

(Moving average of YM)/(moving average of ES)

This is a ratio of the 2 moving averages of the two different futures contracts plotted on a chart?

Thanks in advance H. Hampton.


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Day 96 Missiles Hit Kuwait and Bahrain: June 15 Peace at …
Prediction Markets & Event Contracts
Kalshi Sets $4.13B All-Time Weekly Record as Polymarket …
Prediction Markets & Event Contracts
Victory Day Delivers: Russia-Ukraine Ceasefire Market Cl …
Prediction Markets & Event Contracts
The Confluence Meter: A Multi-Layered Signal Framework B …
The Elite Circle
Orban Crashes to 21pct on Record Turnout -- McIlroy Drop …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #2 (permalink)
wmueller
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.


Reply With Quote




Last Updated on April 5, 2017


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts