Implementing certain signals through indicator patterns
Author: kbellare
Creation Date: 5/8/2014 5:17 PM
profile picture

kbellare

#1
Looking to see if there's an indicator or sample code that helps identify these 3 events that can be used as signals

1) Auto-draw a trend line envelope (for last 5-10 bars) if there's a reasonable trend quality, and signal if there's a trend-line break (i.e. cross-over/cross-under) - Note, I tried TrendlinePeaks/TrendlineTroughs, but it doesn't have a Period parameter (for a 5bar or 10bar trend) and it only connects 2 peaks over large # of periods - doesn't optimize across multiple peaks/troughs to generate a Best-fitting tight enveloper over a high-quality trend.

2) Auto-draw a Horizontal Support/Resistence line and signal if there's a Bounce off S/R

3) Bounce off a Simple Moving Average

Pl. advise most suitable indicator (saw several trend indicators but no Trend-Line envelope indicator) for these and any sample code that implements "Bounce detection"
profile picture

Eugene

#2
2) Not exactly the S/R line but nonetheless here's some fine visuals. Don't remember where I got this from, probably converted Dion's code from WL3/4 times or maybe it's Robert's creation:
CODE:
Please log in to see this code.


3) A three-bar pattern where price is above the SMA, then touches it, and finally rebounds is very easy to code. But of course you're looking for a more flexible pattern where the movement can happen over any reasonable number of bars. The logic and math is exactly the same, you just need to apply this design pattern:

Tutorial: Setups, Triggers, Delays, and Timeouts

The article features just one setup...
CODE:
Please log in to see this code.

...Whereas you are going to have three, enclosed like in this pseudocode:

CODE:
Please log in to see this code.


5/20/2014 EDIT: fixed code error (copy/paste).
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).