Jump to content
  • 0

Backtesting incorporating ProScreener??




I'm new to this community, so first let me introduce myself! My name is Barry (I suppose most of you already guessed that by my username!) and I'm just starting out on this exciting journey to find out "how to profit from trading".

I've done quite a bit of research, and tried setting up lots of strategies to backtest (none of them successful, so far!). I would like to proceed with my latest strategy which involves running a ProScreener script at the end of each trading day (I'm currently looking at the UK shares market), to select which shares to run in AutoTrading mode the following day. I can backtest this strategy by running the strategy for a number of days, but what I'm having a problem with is how to 'backtest' the ProScreener script. There doesn't seem to be a way to run the ProScreener script at a certain date/time (in the past)

As a work-around, I've build an indicator which "looks backwards" a certain number of periods, to show me what the indicator would have shown, had I run it at that date/time. I then reference this indicator in a ProScreener script to effectively show the list of shares that the ProScreener script would have given me, had I run it on that date/time.

Anyone still with me?.....Anyway, this seems to work, but, when I check the results of the ProScreener script, they don't match what I am expecting, when I compare manually.

I'm not sure how this forum prefers code to be included, so I am embedding it here. I'm sure someone will let me know the correct way to do this!

Strategy Code:

// looking for crossover in last 'numberPeriods' - offset by 'priorPeriods'

MACDLineVal = MACDline[12,26,9](close)
MACDSignalVal = MACDSignal[12,26,9](close)

longMACDCrossover= (MACDLineVal CROSSES OVER MACDSignalVal) and (MACDLineVal<0)
shortMACDCrossunder= (MACDLineVal CROSSES UNDER MACDSignalVal) and (MACDLineVal>0)

WHILE i < numberPeriods DO

WHILE i < numberPeriods DO

return longMACDCrossoverCount as "LONG Crossovers in Last numberPeriods",shortMACDCrossunderCount as "SHORT Crossunders in Last numberPeriods",10*longMACDCrossoverCount+shortMACDCrossunderCount as "Signal",Date[priorPeriods]-20210200 as "Date"


ProScreener Code:

ignored, ignored, indicator1, ignored = CALL "FTSEMACDLastXPeriodsOffset"[204, 24]
c1 = (indicator1 > 0)

ignored, ignored, criteria, ignored = CALL "FTSEMACDLastXPeriodsOffset"[204, 24]

SCREENER[c1] (criteria AS "Signal")


Happy to explain in more detail if anyone out there thinks they understand my problem!


Thanks for reading........

Link to comment

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • image.png

  • Posts

    • Fears of a wider regional conflict in the Middle East weighed on market sentiment overnight, though a higher open is expected for the Dax. This flight to safety was triggered by news of an Iranian strike on Israel with hundreds of drones and missiles, raising concerns over potential Israeli retaliation. Safe-haven assets like gold and the US dollar strengthened, though the Japanese yen weakened to a 30-year low against the dollar, highlighting that interest rates remain the primary market focus despite geopolitical risks. Oil prices dipped in Asian trading as the risk of Iranian retaliation was already priced in last week. While the US has stated it will not take part in a counter-offensive against Iran, the volatility index remains near five-month highs, reflecting heightened market nervousness. Any further oil price increases could add to inflationary pressures, complicating central banks' efforts to control rising consumer prices. This week, markets will closely watch US economic data releases, including retail sales and comments from Federal Reserve officials, for clues on the monetary policy outlook amid persistent inflation concerns. The US earnings season is also underway, with mixed results from major banks getting the season off to a lacklustre start.  
    • TXN Elliott Wave Analysis Trading Lounge Daily Chart, Texas Instruments Inc., (TXN) Daily Chart TXN Elliott Wave Technical Analysis   FUNCTION: Trend MODE: Impulsive STRUCTURE: Motive POSITION:  Minor wave 3 DIRECTION: Upside in wave 3.     DETAILS: We are looking at either an extension in Minor wav 3 in the making, or else we are still in wave {b} of 2. The most bearish scenario is the one where the move off the 140$ bottom is not a wave 1 and we are still in a larger degree correction.       TXN Elliott Wave Analysis Trading Lounge 4Hr Chart, Texas Instruments Inc., (TXN) 4Hr Chart TXN Elliott Wave Technical Analysis   FUNCTION: Counter Trend MODE: Corrective STRUCTURE: Flat POSITION: Wave {ii}   DIRECTION: Bottom in wave (c) of {ii}. DETAILS: We are looking at a clear three wave move in wave {ii} with a bottom soon to be in place, looking for the beginning of MGM2 at 165$ to provide support.               Welcome to our TXN Elliott Wave Analysis Trading Lounge, where we delve into Texas Instruments Inc. (TXN) using Elliott Wave Technical Analysis. Let's dissect the market dynamics on both the Daily Chart and the 4H Chart as of April 15, 2024. * TXN Elliott Wave Technical Analysis – Daily Chart* On the Daily Chart, our analysis reveals a trending market characterized by impulsive mode and motive structure, positioned in Minor wave 3. The direction indicates upside momentum in wave 3. However, we are considering two potential scenarios: either an extension in Minor wave 3 or still within wave {b} of 2. The most bearish scenario suggests that the move from the $140 bottom may not be a wave 1, implying a larger degree correction. * TXN Elliott Wave Technical Analysis – 4hr Chart* Here, we observe a counter trend market marked by corrective mode and flat structure, positioned in Wave {ii}. The direction hints at a bottom forming in wave (c) of {ii}. Our analysis identifies a clear three-wave move in wave {ii}, with a bottom expected soon. We anticipate support to emerge around the beginning of MGM2 at $165.   Technical Analyst : Alessio Barretta   Source : Tradinglounge.com get trial here!  
    • ASX: RIO TINTO LIMITED – RIO Elliott Elliott Wave Technical Analysis TradingLounge (1D Chart) Greetings, Our Elliott Wave analysis today updates the Australian Stock Exchange (ASX) RIO TINTO LIMITED – RIO. We have identified that RIO may have completed the ((ii))-green wave at the 114.88 low, allowing the ((iii))-green wave to open up to push much higher. We will continuously monitor and update not only RIO but also the TOP 50 ASX Stocks and provide the best forecasts. ASX: RIO TINTO LIMITED – RIO Elliott Wave Technical Analysis   ASX: RIO TINTO LIMITED – RIO 1D Chart (Semilog Scale) Analysis Function: Major trend (Minor degree, red) Mode: Motive Structure: Impulse Position: Wave ((iii))-green of Wave 3-red Details: The short-term outlook suggests that wave ((ii))-green appears to have completed around 114.88, and wave ((iii))-green is now unfolding to push higher. Maintaining a price level above 121.10 would be advantageous and also serves as a strong support for this perspective. Invalidation point: 102.51       ASX: RIO TINTO LIMITED – RIO Elliott Wave Technical Analysis ASX: RIO TINTO LIMITED – RIO 4-Hour Chart Analysis Function: Major trend (Minute degree, green) Mode: Motive Structure: Impulse Position: Wave iii-blue of Wave (iii)-purple of Wave ((iii))-green Details: The shorter-term outlook indicates that wave ((iii))-green is currently unfolding to continue pushing higher. The immediate targets could be around 134.68 and 139.59, or even further. Maintaining above the level of 125.10 would be advantageous, serving as both a support level and strengthening the bullish perspective. Invalidation point: 114.88       Conclusion:   Our analysis, forecast of contextual trends, and short-term outlook for ASX: RIO TINTO LIMITED – RIO aim to provide readers with insights into the current market trends and how to capitalize on them effectively. We offer specific price points that act as validation or invalidation signals for our wave count, enhancing the confidence in our perspective. By combining these factors, we strive to offer readers the most objective and professional perspective on market trends. Technical Analyst: Hua (Shane) Cuong, CEWA-M (Master’s Designation). Source : Tradinglounge.com get trial here!  
  • Create New...