GAP DOWN incorrect results.
Forums › ProRealTime English forum › ProScreener support › GAP DOWN incorrect results.
- This topic has 8 replies, 2 voices, and was last updated 5 years ago by kumar_AK.
Tagged: gap
-
-
04/09/2019 at 12:22 AM #95774
HI There,
I am using the below code and seems to be getting incorrect results. Wondering why this is happening.
I am looking for gap downs. I got these two stocks in my scan have no clue why they came in my scan. NAB & PNI.
I doubt I may be missing the real gaps as well. if some one can help me fixing the code would be appreciatable.
O H L C NAB-5/4/19 24.91 24.95 24.76 24.79 NAB-8/4/19 24.85 24.89 24.55 24.68 PNI-5/4/19 5.33 5.39 5.205 5.385 PNI-8/4/19 5.4 5.57 5.4 5.47 code:
12345678910111213141516171819202122// Initialization of AmplitudeAmplitude = 0.002// Initialization of detectorDetector = 0// Gap Down// 1st condition of the existence of a gapIF High < Low[1] THEN// 2nd condition of the existence of a gapIF ABS((High – Low[1]) / Low[1]) > Amplitude THEN// Behavior of the detectorDetector = 1ENDIFENDIFc1 = volume >50000c2 = Close > 0.20indicator1 = ExponentialAverage[20](close)indicator2 = Average[20](close)c3 = (indicator1 < indicator2)indicator3 = MACDline[12,26,9](close)indicator4 = ExponentialAverage[9](indicator3)c4 = (indicator3 < indicator4)SCREENER[Detector and c1 and c2 and c3 and c4] (LOW[1] AS “% Previous Low “)thanks04/09/2019 at 1:41 AM #95775To write code, please use the <> “insert PRT code” button to make code more readable. Thank you.
As for NAB, line 9 reports 0.005 which is greater than Amplitude, so it’s ok. Maybe your formula is wrong, what did you mean to achieve with that expression?
Moreover line 15 is easily higher than 0.20, being 24.68 the closing price. Once again, what was your aim?
I made a strategy out of your screener. You can backtest it and use GRAPH to spot what value your variables retained at each candle closure (see pic) so that you can easily debug it:
123456789101112131415161718192021222324252627282930// Initialization of AmplitudeAmplitude = 0.002// Initialization of detectorDetector = 0// Gap Down// 1st condition of the existence of a gapIF High < Low[1] THEN// 2nd condition of the existence of a gapIF ABS((High - Low[1]) / Low[1]) > Amplitude THEN// Behavior of the detectorDetector = 1ENDIFENDIFc1 = volume >50000c2 = Close > 0.20indicator1 = ExponentialAverage[20](close)indicator2 = Average[20](close)c3 = (indicator1 < indicator2)indicator3 = MACDline[12,26,9](close)indicator4 = ExponentialAverage[9](indicator3)c4 = (indicator3 < indicator4)//SCREENER[Detector and c1 and c2 and c3 and c4] (LOW[1] AS "% Previous Low ")buy at -close limitgraph ABS((High - Low[1]) / Low[1])graph Amplitudegraph c1graph c2graph c3graph c4graph Detector04/10/2019 at 1:46 AM #95893Hi RObert,
thanks for your reply.
my aim is to find all the stocks open gap down and still gap exists. ( today high is < yesterday low)
like-2 to line 13 I am expected to filtered (NAB & PNI)
My criteria as below:
- find stocks that have current gaps today
- today volume is more than 50000
- price is more than 0.20
- EMA 20 > MA20
- MACD is above SIGNAL line
can you please check my code is meeting my criteria.
I could have used Amplitude = 0.001
I increased it to 0.002 to get little bit big gaps.
thanks
kumar
04/10/2019 at 7:23 AM #95902Your code is correct, you have just to change line 18, replacing “<“ with “>”.
Why NAB shouldn’t have been reported? It meets your requirements!
04/10/2019 at 8:43 AM #95912thanks for line 18. I will correct it.
NAB & PNI both should not be reported reason is below.
this scan was produced on 8-4-19 (Monday). Day before is 5-4-19 (Friday).
NAB do not have gap down on monday. OPEN = 24.85 & HIGH = 24.89 ; Friday LOW = 24.76 as per line 7 it should be filtered out.
PNI do not have gap down on Monday. OPEN = 5.40 & HIGH = 5.47 ; Friday LOW = 5.205 as per line 7 it should be filtered out.
I expect if HIGH 24.89 is lower than previous day low (i.e: LOW[1] = 24.76) & PNI.
please correct me if i am wrong.
04/11/2019 at 11:03 AM #96048Sorry, I can’t fine ant NAB, nor PNI, stock code bot on IG and PRT. Can you provide the name of the company, please?
Do you have end-of-day data?
04/11/2019 at 12:46 PM #96071NAB —–National Australia Bank
PNI —Pinnacle Invert Mgmt Grp Ltd
Both are ASX- Australian stock exchange.
Screen shots are attached. LAst bar ON right hand side (RHS) belongs today which is 11/4. we are talking about Monday & Friday bars. That means 4th and 5th from RHS
04/11/2019 at 1:59 PM #96093I asked if you have emd-of-day data, but you did not answer.
I think that is the issue, since you cannot access the MONDAY data, so HIGH refers to friday 5th and LOW[1] refers to Thursday 4th, in which cases it’s ok both for NAB and PNI.
04/14/2019 at 4:49 AM #96378HI RObert,
I have checked with IG markets. My account is live account and all my data is live data.
I have these results on 8th during market open and even after market closed. (late night).
I have no clue. your logic seems to be correct. both stocks have gap down on 5 th april.
I will post you if I see more of this type.
thanks
-
AuthorPosts
Find exclusive trading pro-tools on