I would appreciate your help with this code.
I downloaded the code for pattern recognition specifically for dbl btms from
http://www2.wealth-lab.com/WL5WIKI/PatternRecognition.ashxIf you look at the chart I attached it posts the stock when price hits the higher red circle but I want to to post when it hits the 1st red circle (on the actual retest of the bottom).
The code doesn't really include the logic from what I see (and I am just starting to code) almost like its pulling the logic from somewhere else within WealthLab.
Any help would be GREATLY APPRECIATED!!!
Size:
Color:
This is not an issue (so I've renamed the improperly titled thread), it's just by design. Detection of patterns cannot happen where you want it to i.e. when it hits the 1st red circle. At this point in time it would take a crystal ball in an ideal world to call it a bottom. :)
There's a natural delay for any pattern recognition algorithm to do its job under the hood. Specifically, this one uses
TroughBar and, as said in its online usage guide the Wiki, it will lag and report troughs a few bars later than they actually occurred in hindsight which is unavoidable when backtesting trading systems. The line to the right leg of the W Bottom is drawn after the fact on the bar that precedes the Alert (the bar with reddish background).
In summary, there's no
artificial delay here and nothing to worry about.
Size:
Color:
Thank you for the response. If you can identify the 1st peak, a list of all hits retesting tat peak would be perfect, leaving it up to me and my rules when and if to enter the trade. By the time it hits a traditional dbl btm or dbl top scan, I am in the trade a few days.
Is this possible, to get a hot of retests of the peaks or Trough on the retest, leaving it to the trader to decide when and if to enter?
Size:
Color:
Sure it's possible. Here's a helpful design pattern for you to learn:
WealthScript Techniques | Setups, Triggers, Delays, and TimeoutsUsing it you can express your idea like does the code below. Speaking of double bottoms, it saves the first leg once found and enters on a limit order at the 1st leg's price - which is a retest. This is only an example so I leave the rest up to you to experiment and to improve:
CODE:
Please log in to see this code.
Size:
Color:
I just ran it on the SP100 for 1991 to 2016 and there wasnt 1 signal. I will look at it over the weekend but there must be something wrong. Thanks for the help.
Size:
Color:
reran it and it had 935 trades over the past 15 years. Need to look through it but thanks for the head start.
Size:
Color:
To run on entire S&P 100, choose a Raw Profit position size - like 100 shares. This way you shouldn't get any signals skipped due to insufficient capital.
Size:
Color:
Here's another take on it. Set a minimum width (between the anticipated double bottom), and here I used 10% excursions for identifying troughs.
CODE:
Please log in to see this code.
Size:
Color: