Convert close crosses moving average from TC2000 to Thinkorswim


0
0

Hi Pete ,here again now with the screenshoots and information to see if we can adjust this strategy from TC 2000 to TSO.

How i said i used this indicator to know how long stay in a trade,also i used to go in a trade ,most used to swin trading. Im dont know nothing about code also just going to start trading in January as full,so i see you help a person with a formula from TC 2000,and i see what you do and i tried and get the result i load here.

But i only can get 1 peak color at time.Hope you can help me with it,i think is a good indicator combine with MACD and Rate of change.

I also want to use it at a scanner y tried and give me some reults,but im not shure if it is correct.

Thanks

Chris

Attachments:
RESOLVED
Marked as spam
Posted by (Questions: 2, Answers: 1)
Asked on September 20, 2018 4:15 pm
213 views
0
Private answer

Looks to me like you nearly had it. You only had one plot in your code. Which would explain why you only got green spikes and no red. You need to have a second plot in your code, one to cover each condition. And set each to the appropriate color.

def C = close;
def avgc10 = Average(close, 10);
def c1 = close[1];
plot crossAbove = C > avgc10 and c1 < avgc10[1];
crossAbove.SetDefaultColor(Color.GREEN);
plot crossBelow = C < avgc10 and c1 > avgc10[1];
crossBelow.SetDefaultColor(Color.RED);

Screenshot below shows result.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on September 21, 2018 8:04 am
0

Thanks Pete it work great…you are the best…

( at September 21, 2018 10:15 am)