Scan for 10 SMA crossoover 20 SMA multiple times


Category:
0
0

Hi Pete

Hope all is well

Can you please help me set up a scan.

I created a simple moving average (SMA ) crossover arrows.

if 10 SMA crossed above the 20 SMA then Yellow arrow, and if the 10 SMA crossed below the 20 SMA then Purple arrow.

what I am a looking for is a way to scan for

– Yellow arrow then purple arrow then yellow arrow then Purple arrow then yellow then purple and so on in a a matter of 45 periods.

Appreciate your help here

 

 

Marked as spam
Posted by (Questions: 13, Answers: 13)
Asked on November 16, 2019 6:13 pm
221 views
0
Please provide the code you are using for this so we have something to work with.
( at November 16, 2019 6:59 pm)
0
Private answer

We are still waiting for you to provide the code that draws the yellow and purple arrows you described in the body of your question.

Marked as spam
Posted by (Questions: 37, Answers: 4091)
Answered on November 24, 2019 12:29 pm
0
The code that draws the yellow the purple arrows is a TOS code. here below # TD Ameritrade IP Company, Inc. (c) 2009-2019 # #wizard input: length1 #wizard text: -period #wizard input: averageType1 #wizard text: crosses #wizard input: crossingType #wizard input: length2 #wizard text: -period #wizard input: averageType2 #wizard text: Price: #wizard input: price input price = close; input length1 = 15; input length2 = 30; input averageType1 = AverageType.Simple; input averageType2 = AverageType.Simple; input crossingType = {default above, below}; def avg1 = MovingAverage(averageType1, price, length1); def avg2 = MovingAverage(averageType2, price, length2); plot signal = crosses(avg1, avg2, crossingType == CrossingType.above); signal.DefineColor("Above", GetColor(6)); signal.DefineColor("Below", GetColor(7)); signal.AssignValueColor(if crossingType == CrossingType.above then signal.color("Above") else signal.color("Below")); signal.SetPaintingStrategy(if crossingType == CrossingType.above then PaintingStrategy.BOOLEAN_ARROW_UP else PaintingStrategy.BOOLEAN_ARROW_DOWN);
( at November 24, 2019 2:35 pm)
0
Ok, thanks for that. It would have been best if you would have included that with your original question. As well as a screenshot showing an example. The default settings for this code do not produce a series of up and down arrows as you describe. So what settings did you use to produce this series of up and down arrows within a 45 bar period?
( at November 24, 2019 8:02 pm)
0
Private answer

Please respond when I leave a comment requesting more information. I should not have to post a new answer to your topic to get you to recognize that I have posted a new comment requesting more information.

Here is the text of the comment I left requesting more information:

Ok, thanks for that. It would have been best if you would have included that with your original question. As well as a screenshot showing an example. The default settings for this code do not produce a series of up and down arrows as you describe. So what settings did you use to produce this series of up and down arrows within a 45 bar period?

Marked as spam
Posted by (Questions: 37, Answers: 4091)
Answered on December 6, 2019 6:54 pm