I have been trying to set up a Proscreener to find stocks when a 10 and 21 EMA is still > than a 200 SMA after 30 periods have past. Should be simple but the imput screen goes into shock and starts to shake when I try to set the 30 periods.
Anyone who can give me a clue whats going wrong.
Allonso
You can do that by summarize all the boolean “true” value other the last 30 periods, if the result is 30, the screener will return you the shares:
condition = exponentialaverage[10]>average[200] and exponentialaverage[21]>average[200]
a = summation[30](condition)=30
screener[a]
Hi Nicholas,
My aplogies for not thanking you earlier for your help, been somewhat overwhelmed with work. It all worked well, the problem is that althougth the conditions were met, the current situation had changed and therefor did not indicate future direction as I had thought.
I have tried another tack the initial condition being that the price close CROSSES OVER the Average(200) 5 Days previously from the current date. However what is happening is that those stocks it finds where the price Crosses above the Average can be anything from 1 to 15. I developed the code using simplified creation. Can you suggest how I can get it to do what I want.
Thank you in advance for any assistance.
Allonso
However what is happening is that those stocks it finds where the price Crosses above the Average can be anything from 1 to 15.
Sorry but ‘from 1 to 15’ what?
Anyway, this is the code you should use about your new query:
a = close crosses over average[200]
test = summation[5](test)>0
screener[test]
Hi Nicholas,
Sorry but as I mentioned 5 days from the current date previously I assumed you would understand that I meant that it was showing stocks with crosses from 1 day to 15 days from current date, my apologies and thanks for the code. will test and see what I get.
Is there a limit on the number of times “summation” can be used I any program.
My thanks again Allonso
oh yes sorry, but I’m jumping from a question to another, so sometimes I should also read between the lines..
You can use use SUMMATION as many times you want in the same code.
Hi Nicholas,
For some reason the code is not being accepted. It says (“Syntax Error ” This variable is not used in the code: a)
Allonso
I think there is a typo and it should be:
a = close crosses over average[200]
test = summation[5](a)>0
screener[test]
Hi,
Just tried the correction by Vonasi, It fetches all stocks even those below the AVG 200, and so far I cannot locate any stock that has crossed above the AVG 200 in the last 5 days from the current day. No idea why, hope you can Help.
Thanks Allonso
Despite the fact that the shares has crossed at least one time during the last 5 candles, it doesn’t mean that the price is still above the MA200, you can add a condition to test it too:
a = close crosses over average[200]
test = summation[5](a)>0 and close>average[200]
screener[test]