Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 23:49:16 +0000



[User Discussion] - Moving Average Crossover

View Count: 1987

[2014-02-03 12:49:43]
infpz - Posts: 826
Hello,

I am using the moving averages indicator. I am using 2 of the 3 and would like them colored based on crossover. More specifically, I want them colored green when the faster crosses above the slower, and red when the faster crosses below the slower. How would I accomplish this?

Patrick Z
[2014-02-03 13:53:32]
Sawtooth - Posts: 3993
To color both lines the same color based on the faster MA:

1) Add the Color Bar Based On Above/Below Study study
-Set the Based On to the MA study
-Set the Input Data to Avg1
-Set the Study Reference to the MA study and Avg2
-Set the Mode to Color Above/Below
-Set the Output Input Data Values Instead of 1.0 to Yes
-Set the Draw Style to Line

2) Add another Color Bar Based On Above/Below Study study
-Set the Based On to the MA study
-Set the Input Data to Avg2
-Set the Study Reference to the MA study and Avg1
-Set the Mode to Color Above/Below
-Set the Output Input Data Values Instead of 1.0 to Yes
-Set the Draw Style to Line
-Reverse the red and green colors (red on left, green on right)

#1 colors the faster MA, #2 colors the slower MA.
This assumes you are using the Moving Averages study's Avg1 and Avg2, and that Avg1 is the faster MA and Avg2 is the slower MA.


[2014-02-03 17:57:52]
infpz - Posts: 826
Thanks Tom, do you do any contract programming for Sierra? If you are interested please email me: pz@infinityfutures.com


[2014-02-03 19:59:41]
Sawtooth - Posts: 3993
http://sawtoothtrade.com/services/
[2019-11-01 14:57:06]
osaga - Posts: 53
It should also be noted that you need to hit the "Insert" key or go to the Chart menu and select "Reload and Recalculate". This needs to be done to recalculate this study so both lines show up.

Thanks to Tom from Sawtooth for this great answer.
Date Time Of Last Edit: 2019-11-01 14:58:10

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

Login

Login Page - Create Account