Alteration to EMA Cross


Category:
0
0

Watch_EMA_XSTUDY.ts

I guess this was done a couple of years ago. I found it in watchlists on the home page. The question there was can the code be changed without much trouble to reflect the stock price as above or below a certain EMA. In another way If the stock value is above a certain EME then the watchlist column  would continuously display that it was above until the value falls below That EMA. Then the watchlist would display that the value was below that EMA. I use the 8 EME as a trigger. IF I want to make a long trade I watch for a closing price above the 8 EMA. AS long as the stock price stays above that I leave it alone. If the stock price falls below that I create a stop order so if it continues down I get out. I was also trying to say I was able to change the code to reflect the 8 EMA rather than the 21 EMA that was already there and I was also able to manipulate the colors myself. I just can’t figure out the code change to get those results. I hope his is more clear.

Marked as spam
Posted by (Questions: 5, Answers: 5)
Asked on March 12, 2017 3:43 pm
248 views
0

Thanks! Without a question you are a dream come true.

( at March 12, 2017 6:38 pm)
1
Private answer

Ok, I got it now. Thanks for providing those details. The webpage the viewer is referring to is here: https://www.hahn-tech.com/thinkorswim-custom-watch-list-columns/

It is much easier for others who run across this post to find all the details if we link them to the full webpage where the code was located.

In order to change the behavior of that code to meet your specifications we only need to change a single line:

def priceCrossAboveEMA = close[1] < emaValue[1] and close > emaValue;

Just replace that line with this one:

def priceCrossAboveEMA = close > emaValue;

Whatever the other changes are that you made, should be able to work with this modification. Please don’t forget to up-vote any questions that best solve your question. If you need explanation or further adjustments just post them as a comment to this answer.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on March 12, 2017 5:22 pm