Custom Watchlist Column for EMA Crossing


Category:
0
0

Hello Pete, I have the following custom TOS watchlist code for EMA crossing that works well but I was wondering if you could help me with the following two items i haven’t been able to figure out.

1- Eliminate after hours/pre-market data input so that only regular market data is used.

2- Add a timing feature so that the cross over (green) and cross under (red) signals are only displayed for one (1) minute after happening. Then the watchlist cell goes back to neutral (empty)

Thank you for the help and great work.

 

 

def X = MovingAverage(AverageType.EXPONENTIAL, close, 8);

def Y = MovingAverage(AverageType.EXPONENTIAL, close, 34);

def Z = X – Y;

AssignBackgroundColor(if X > Y then createcolor(50,180,50) else if X < Y then color.red else color.current);

AddLabel(yes, AsText(Z, NumberFormat.TWO_DECIMAL_PLACES));

 

 

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on October 31, 2018 9:11 am
249 views
0
Private answer

Neither of the items you have requested are addressed through the code. To be more specific. The inclusion/exclusion of extended trade data is simply applied by the settings. A checkbox next to where you set the time frame for the custom column. It is impossible to install a timing feature (as you have described) that uses something other than the time frame you have selected.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on October 31, 2018 11:11 am
0

Thank you for the quick response and the information provided.

( at October 31, 2018 12:02 pm)