Screener result – limit to present/ongoing period results
Forums › ProRealTime English forum › ProScreener support › Screener result – limit to present/ongoing period results
- This topic has 5 replies, 2 voices, and was last updated 7 years ago by Per.
-
-
07/11/2017 at 7:23 AM #40305
Request for assistance, after unsuccessful search in manuals etc.
My challenge: As screening for triggers in real time (week & daily charts), the result list findings/triggers from the past which is not interesting.
As I am using the screener to notify me for trigger to trade in present (now), I have the following Question: How can the results/findings be limited to present covering the bars involved, (as for indicators >defparam DRAWONLASTBARONLY = TRUE) to apply screeners to pop up my triggers in the list as they comply with my criteria’s in present only?
Help will be appreciated with thanks.
See enclosed list where triggers listed are obsolete, days and week back in time! (note. the clock column is the time when screener started this morning)
Per Hovden
07/11/2017 at 9:57 AM #40326The results you get from the screener window depend of your code. If you flag a variable to 1 because your conditions are met, you also need to set it to 0 when they are not, otherwise at the end of the history load, the result will still be true and you’ll get old results.
07/11/2017 at 11:26 AM #40340Thanks Nicolas,
Based on your reply, I reviewed a few screeners presented on this site and found examples of | Variable: else > Position = 0 | This is aligned with my code, however I am not sure if I interpret correctly?
For simplicity, if you have an example code it will be helpful or simply add it to the code. Whatever is to your preference.
Tanks again.
Per
My code:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546REM Turning Candle formation with Bollinger B on steroids (high/low pivots)//GeneralmyBollUp = Average[11](close)+1.5*std[11](close)myBollDn = Average[11](close)-1.5*std[11](close)//Longif ADX[7] > 50 then // High ADX level = iminent changeif open[1] > close[1] then // Red candle [1]if low[1] < myBollDn then // Yesterday low, outside BBif open[0] > Low[1] then // Today open > yesterday Lowif Low[0] < Low[1] then // Today Low < yesterdayif close CROSSES OVER close[1] then // Today price, crosses back above yesterday high closes > yesterdayPosition = 1elsePosition = 0endifendifendifendifendifENDIFREM Shortif ADX[7] > 50 then // High ADX level, change commingif open[1] < close[1] then// Greencandle[1]if high[1] > myBollUp then // Yesterday high, outside BBif open[0] < High[1] then // Open < yesterday high (to extend above)if close CROSSES UNDER high[1] then // Today price Crosses under yesterday highPosition = -1elsePosition = 0endifendifendifEndifENDIFIf Position = 1 thenelsif Position = -1 thenCriteria = 1elseCriteria = 0endifSCREENER [CRITERIA](Position AS "L.+1/S.-1")07/12/2017 at 1:16 PM #40448I changed the code to be faster in its calculation, it works but I can only find stocks with Position=-1, so there must be something not good in your bullish conditions, but don’t know what sorry! 🙂
12345678910111213141516171819REM Turning Candle formation with Bollinger B on steroids (high/low pivots)//GeneralmyBollUp = Average[11](close)+1.5*std[11](close)myBollDn = Average[11](close)-1.5*std[11](close)//Longif ADX[7] > 50 and open[1] > close[1] and low[1] < myBollDn and open[0] > Low[1] and Low[0] < Low[1] and close CROSSES OVER high[1] then // Today price, crosses back above yesterday high closes > yesterdayPosition = 1//shortelsif ADX[7] > 50 and open[1] < close[1] and high[1] > myBollUp and open[0] < High[1] and close CROSSES UNDER high[1] then // Today price Crosses under yesterday highPosition = -1elseposition = 0endifcriteria = Position <> 0SCREENER [CRITERIA](Position AS "L.+1/S.-1")07/12/2017 at 1:19 PM #40449I found why, I changed the close CROSSES OVER in the bullish condition, here is my code with your initial condition for the cross (now found +1 Position):
12345678910111213141516171819REM Turning Candle formation with Bollinger B on steroids (high/low pivots)//GeneralmyBollUp = Average[11](close)+1.5*std[11](close)myBollDn = Average[11](close)-1.5*std[11](close)//Longif ADX[7] > 50 and open[1] > close[1] and low[1] < myBollDn and open[0] > Low[1] and Low[0] < Low[1] and close CROSSES OVER close[1] then // Today price, crosses back above yesterday high closes > yesterdayPosition = 1//shortelsif ADX[7] > 50 and open[1] < close[1] and high[1] > myBollUp and open[0] < High[1] and close CROSSES UNDER high[1] then // Today price Crosses under yesterday highPosition = -1elseposition = 0endifcriteria = Position <> 0SCREENER [CRITERIA](Position AS "L.+1/S.-1")1 user thanked author for this post.
07/12/2017 at 6:34 PM #40485This is a great improvement.
11 results found within all forex pairs provided by PRT. 2 findings on weekly charts. I am applying the same combination for Indicators, which now correlates with the findings in present by the screener.
I will add that by entering trade at crossing back over yesterday high/low, adding SL at today high/low this is a one bar (daily chart) trading strategy. With some guts, go trailing stop loss at entry on the next bar and cross the fingers, it may be the start of a lasting trend and success in caching the famous falling knife (and/or opposite). This will be studied by back testing and paper trading scripts. ps. ensure that momentums are right.
Appreciated and great thanks,
Per I
-
AuthorPosts