Login Page - Create Account

Support Board


Date/Time: Fri, 19 Apr 2024 23:39:17 +0000



Help with Moving Average Difference Study

View Count: 1622

[2018-06-15 21:53:57]
rwilliams1 - Posts: 339
Hi, I am using the Chart Line Overlay to compare two instruments to each other for pair trading/stat arb. I'm am trying to find a way to plot the difference between the two using the Moving Average Difference study histogram which is perfect for what I am trying to do. I was going to assign a 1 period moving average to each instrument and plot the difference with the MA Difference Study. However, I haven't found a way to assign a moving average to each separate instrument. Any help or suggestions for doing this would be greatly appreciated. Thx.
[2018-06-22 05:35:30]
Sierra Chart Engineering - Posts: 104368
Refer to the Based On setting:
Chart Studies: Settings and Inputs Tab >> Based On - Basing a Study on Another Study

And also to this particular study:

https://www.sierrachart.com//index.php?page=doc/StudiesReference.php&ID=185&Name=Study_Subgraphs_Subtract_-_Difference
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-06-22 05:35:55
[2018-06-22 05:49:48]
Sierra Chart Engineering - Posts: 104368
For what you want to do, you do not want to use the Moving Average Difference study. That study is only setup to compare a single instrument with different Moving Average Lengths.

Rather, what you want to do is to use the Overlay studies and then put Moving Averages onto them. Then use the Study Subgraphs Difference study to display the difference in the Moving Averages.

We have attached a Study Collection to this post that has this setup using the Highs and Lows for the overlays. You will find the information for how to use this Study Collection here:
Study Collections: Using a Study Collection Provided by Sierra Chart Support
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
attachmentHighLowPriceOverlaysWithMovingAverageAndMADifference.StdyCollct - Attached On 2018-06-18 15:11:37 UTC - Size: 46.61 KB - 282 views
[2018-11-13 06:36:39]
rwilliams1 - Posts: 339
Thank you for the study collection you supplied a while back. I have been trying diligently to plot the difference between symbols as a histogram using your study collection, however, no matter what I try I cannot seem to get it to plot correctly. I am plotting a simple calendar spread of Oil CL as a test, but have not been successful.

I've attached a screenshot of what I am seeing and also the study collection parameters I am using. Any help you could provide on helping me to plot this correctly is greatly appreciated as I have not been able to figure it out. Thanks.
imageTEST - High Low Price Overlays Histogram.png / V - Attached On 2018-11-13 06:35:03 UTC - Size: 52.3 KB - 296 views
attachmentTEST-HighLowPriceOverlaysWithMovingAverageAndMADiffer.stdycollct - Attached On 2018-11-13 06:35:11 UTC - Size: 46.61 KB - 260 views
[2018-11-13 18:38:55]
Sierra Chart Engineering - Posts: 104368
What do you mean "indicator does not plot as a histogram"? What is wrong with what you see? What does a histogram mean for you?
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-11-13 18:39:35
[2018-11-13 20:55:39]
rwilliams1 - Posts: 339
The histogram that I am referring to is one that oscillates above and below a zero center line similar to a MACD. Attached are two separate examples from Metatrader Pair trading indicators which I am trying to duplicate in SC.
imagePair Trade Histogram.png / V - Attached On 2018-11-13 20:54:24 UTC - Size: 25.34 KB - 418 views
imagePair Trade Histogram 2.png / V - Attached On 2018-11-13 20:54:31 UTC - Size: 11.18 KB - 391 views
[2018-11-14 06:15:26]
Sierra Chart Engineering - Posts: 104368
Okay not sure why we included the moving averages in the prior Study Collection we provided if you are not interested in calculating the difference between the averages of the underlying Overlay studies. Take those moving average studies out altogether.

And we see no reason why you would have a negative value calculating the difference between two different futures contract months where one is higher than the other.

We also want to point out that your Sierra Chart account is expired.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-11-14 06:16:43
[2018-11-15 21:35:04]
rwilliams1 - Posts: 339
Yes I'm guessing this is because it is plotting the absolute price difference between the two symbols instead of their relative movements. For example, if Symbol A is $100 and Symbol B is $50, then it will plot the indicator at 50. If neither symbol is volatile enough to close the $50 price gap difference, then a price oscillation above/below the zero line will not occur. Can you tell me if there is a way to configure/normalize this Study subgraphs Difference Indicator in a way that will allow me to compare the RELATIVE movement of two symbols in histogram form as shown in my earlier attached screenshots?

I also had a question about your Spread 4 indicator and other spread/difference indicators. I noticed that the live bars REPAINT and do not print the wicks of the live bar's price movement. So there is no way of knowing how high or low the current bar has been. Is there a way to fix this?

And thanks for alerting me about my account, yes I was aware it had expired, but I was going to first work out this indicator situation before subscribing again which I have now done.
[2018-11-16 03:26:05]
rwilliams1 - Posts: 339
I've been playing with the Offset parameter in the Study Subgraphs difference to try and align both symbols to view their relative performance. I offset one symbol by the amount of the difference between the two symbols so that they both start at a similar reference point value. By doing this I am now able to view a histogram that oscillates above and below the zero line.

But I am curious if this is what the Offset parameter is used for? There is no description of the parameter but I am assuming it is used to align two symbols. Is this the purpose of this parameter and am I using it correctly? Thanks again.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account