Close crossing above or below 10 period sma


Category:
0
0

dear Pete, i had the following code of thinkorswing and i want to have on tradestation and wants to know if you can help me to solve this issue.

the code that i want to get on easy language is the following:

def C=close;

def avgc10=Average(close,10);

def c1= close[1];

plot cross Above=C>avgc10 and c1<avgc10[1];

plot cross below=C<avgc10 and c1>avgc10[1];

crossbelow.setdefaultcolor(Color.RED);

I attach a photo on how the indicator looks.

Thanks for all your help and support

Attachments:
Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on September 28, 2018 10:36 pm
191 views
0

Hi Oscar, Couple things.
First, I need to update your question title. The one you entered is far to vague and provides no assistance to other viewers who might have a similar question. When I change the existing question title: “hello, i need help with code of thikorswing to tradestation” this will also break the URL link to this post. I will try to email you the new link after the changes are made.

Second thing is you entered this in the “Frequently Asked Questions” topic, when we already have a topic set aside for “Trade Station Solutions”. So I will be moving this question to that topic to make sure all our viewers understand the context and purpose of your request.

( at September 29, 2018 8:27 am)
0
Private answer

Here is the EasyLanguage version of that code. Screenshot attached shows how it displays on the chart.

Variables: c0(0), avgc10(0), c1(0);
c0 = Close;
avgc10 = Average(c0, 10);
c1 = Close[1];
Plot1(c0 > avgc10 and c1 < avgc10[1], "Cross Above", Green);
Plot2(c0 < avgc10 And c1 > avgc10[1], "Cross Below", Red);

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on September 29, 2018 10:02 am