inserting a ratio on a chart
inserting a ratio on a chart
Can someone tell me how to make a ratio on a chart, for instance UUP:SPX. Thanks - Michael
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: inserting a ratio on a chart
you have to be more specific on your request.Can someone tell me how to make a ratio on a chart, for instance UUP:SPX. Thanks - Michael
do you want to print a text on the chart?
do you want to plot the spread?
can you make a mock up?
Re: inserting a ratio on a chart
I want to plot the ratio as a line chart. I want to have a chart of, say. UUP and in a subchart window above the instrument I want to plot the UUP:SPX ratio fpr use ad an indicator. Thanks.
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: inserting a ratio on a chart
like this?I want to plot the ratio as a line chart. I want to have a chart of, say. UUP and in a subchart window above the instrument I want to plot the UUP:SPX ratio fpr use ad an indicator. Thanks.
if you do a search on "spread", you will find lots of resources:
viewtopic.php?f=5&t=7845&hilit=spread
viewtopic.php?f=5&t=7844&hilit=spread
viewtopic.php?f=5&t=7843&hilit=spread
Re: inserting a ratio on a chart
I don'tknow what a spread ratrio is -- what I want to do is chart one instrument, say UUP. Then I want an indicator that tells me whether UUP is underperforming or outperforming the SPX. So I want to plot a line that is a ratio of one to the other.
are you familiar with stockcharts? There I can make a price indicator that is simply the ratio, UUP:SPX, that's what I'm trying to do in MC.
thanks so much for your help wih this.....
are you familiar with stockcharts? There I can make a price indicator that is simply the ratio, UUP:SPX, that's what I'm trying to do in MC.
thanks so much for your help wih this.....
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: inserting a ratio on a chart
spread ratio is the name of an indicator that comes with MultiCharts.I don'tknow what a spread ratrio is -- what I want to do is chart one instrument, say UUP. Then I want an indicator that tells me whether UUP is underperforming or outperforming the SPX. So I want to plot a line that is a ratio of one to the other.
are you familiar with stockcharts? There I can make a price indicator that is simply the ratio, UUP:SPX, that's what I'm trying to do in MC.
thanks so much for your help wih this.....
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: inserting a ratio on a chart
Dear Misha04,
You should plot UUP as data1, ten add SPX as data2, and insert the following inicator.
Ratio is displayed in %:
You should plot UUP as data1, ten add SPX as data2, and insert the following inicator.
Ratio is displayed in %:
Code: Select all
vars: ratio(0);
ratio = iff( close data2 > 0, close / close data2 * 100, -1 );
plot1(ratio, "Ratio");
Re: inserting a ratio on a chart
Dear Misha04,
You should plot UUP as data1, ten add SPX as data2, and insert the following inicator.
Ratio is displayed in %:
Code: Select all
vars: ratio(0);
ratio = iff( close data2 > 0, close / close data2 * 100, -1 );
plot1(ratio, "Ratio");
Is there a way to add a moving average to the spread ratio? I attempted to insert a EMA to it but it was asking to base the study on an instrument and no option was there to base it on the spread ratio. Please advise...thanks.
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: inserting a ratio on a chart
EasyLanguage is very easy to understand (and program).Dear Misha04,
You should plot UUP as data1, ten add SPX as data2, and insert the following inicator.
Ratio is displayed in %:
Code: Select all
vars: ratio(0);
ratio = iff( close data2 > 0, close / close data2 * 100, 1 );
plot1(ratio, "Ratio");
Is there a way to add a moving average to the spread ratio? I attempted to insert a EMA to it but it was asking to base the study on an instrument and no option was there to base it on the spread ratio. Please advise...thanks.
Read through the codes line by line,
I think you can figure out the logic.
Go download this ebook if you want to do more experiments.
Getting Started with EasyLanguage
https://www.multicharts.com/multicharts ... mentation/
Code: Select all
input:
MA.length(5);
vars:
MA(0),
ratio(0);
ratio = iff( close data2 > 0, close / close data2 * 100, -1 );
MA = average(ratio, ma.length);
plot10(ratio, "Ratio");
plot20(MA, "MA");
Re: inserting a ratio on a chart
Thank you TJ for your post. I attempted adding the lines you posted but it would not compile correctly. Unfortunately, programming does not come easy to me as it does to you.
This is the Spread Ratio script that I wish to have a EMA added:
inputs: DataSeries1( Close of data1 ), DataSeries2( Close of data2 ) ;
if DataSeries2 <> 0 then
Plot1( DataSeries1 / DataSeries2, "SprdRatio" ) ;
This is the Spread Ratio script that I wish to have a EMA added:
inputs: DataSeries1( Close of data1 ), DataSeries2( Close of data2 ) ;
if DataSeries2 <> 0 then
Plot1( DataSeries1 / DataSeries2, "SprdRatio" ) ;
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: inserting a ratio on a chart
What is the error message?Thank you TJ for your post. I attempted adding the lines you posted but it would not compile correctly. ...
I have compiled it, there is no reason why you cannot.
Your code and the code from Dave Masalov gave the same effect,
but your code cannot be used in an average
because if data2 = 0, you will have a missing data slot and the average cannot compute.
Re: inserting a ratio on a chart
I can't figure out what I did wrong the first time, but I inserted your code a second time around and it is working just fine!
Thanks, TJ, for your assistance with this!
Thanks, TJ, for your assistance with this!