HMA and EMA cross to Watch List.


Category:
0
0

Pete

Is it possible to write a code for a watch list of Hull EMA and the 43EMA cross. If the HMA is above the EMA the background is green….If the HMA is below the EMA background is red….Lastly is there a ways to add how many bars ago the cross happened….

Thanks

Marked as spam
Posted by (Questions: 49, Answers: 42)
Asked on September 29, 2019 2:24 pm
169 views
0
Private answer

We already did this:

https://www.hahn-tech.com/ans/how-many-days-ago-ema-cross-on-2hr/

Most of the time, when I provide solutions I try to anticipate all the various ways other viewers may apply the code. So I do my best to provide user inputs so the code can be applied to almost any scenario you can imagine.

Oddly enough, that previous post I linked above was one of your requests.

Using the code provided in that post you will simply adjust the user inputs as follows:

input maLengthOne = 9;
input maLengthTwo = 43;
input maTypeOne = AverageType.HULL;
input maTypeTwo = AverageType.EXPONENTIAL;
input priceOne = close;
input priceTwo = close;
input barsPerDay = 1;

NOTE: You did not specify the Hull moving average length in your request. Change the default input value from 9 to whatever value you desire.

The list of available moving average types are here:

https://toslc.thinkorswim.com/center/reference/thinkScript/Constants/AverageType.html

 

Marked as spam
Posted by (Questions: 37, Answers: 4117)
Answered on September 29, 2019 4:44 pm
0
Pete, It won't let me hit OK when I paste the code in..?
( at September 29, 2019 5:42 pm)
0
Works fine when I test it.
( at September 29, 2019 6:48 pm)