Login Page - Create Account

Support Board


Date/Time: Sun, 24 Nov 2024 11:43:35 +0000



[User Discussion] - TD Moving Averages

View Count: 2574

[2013-11-01 20:33:28]
kona808 - Posts: 12
Hi there,

I was wondering about the possibility of creating the Tom DeMark moving averages? They are very simple, and would be of immense help.

I have listed the conditions below (this is for the "bullish" moving average. Inverse is true for the bearish)

If there is a price low that is higher than all 12 prior price lows, then a moving average is created. The moving average is a five bar moving average of the lows and extends forward for another four bars (the current price bar and three more into the future).

IF, within the next 4 bars,

the market fails to post a fresh low above all 12 prior lows, THEN the moving average of the lows disappears. BUT IF the market records a low greater than all 12 previous low, THEN the 5-bar moving average of the lows will continue for another 4 bars.


[2013-11-01 21:12:23]
Sierra Chart Engineering - Posts: 104368
Please refer to this page:
http://www.sierrachart.com/index.php?l=doc/doc_CreatingDLLs.html

And to this page for programmers:

http://www.sierrachart.com/index.php?l=doc/SierraChartStudyAndSystemProgrammers.html
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2013-11-01 21:12:43
[2013-11-02 18:34:03]
jackw - Posts: 57
You're right, this was a simple one. Attached are the source file and the compiled dll.
Date Time Of Last Edit: 2013-11-02 18:35:29
attachmentTD_Studies.cpp - Attached On 2013-11-02 18:34:55 UTC - Size: 1.36 KB - 588 views
attachmentTD_Studies.dll - Attached On 2013-11-02 18:35:05 UTC - Size: 13.5 KB - 614 views
[2013-11-03 01:17:35]
kona808 - Posts: 12
Hi,

Thanks for your input. Aspects of that are correct, I was able to get something similar, although it needs some minor tweaks in terms of the conditions.

- "Lower Moving Average" is bullish (green) and based on 5 SMA of the lows
- "Upper Moving AVerage" is bearish (red) and based on 5 SMA of the highs
- Both MA's extend 4 price bars ahead
- There would only ever be one MA appearing at one time. For example. A low is higher than all 12 prior lows -> Bullish lower green TD MA appears based on the 5 SMA of the highs -> the bullish lower MA continues as long as price doesn't close below the MA and then reopen below it also, OR as long as price records a low above all 12 prior lows within the next 4 bars

I've attached an image of the SPX daily with the MA's Drawn on as they should appear (note you can't see it extending 4 bars ahead due to the image too short.

Appreciate any input, many thanks.



imageTD MA1.jpg / V - Attached On 2013-11-03 01:16:55 UTC - Size: 978.83 KB - 552 views
Attachment Deleted.
[2013-11-03 19:19:41]
jackw - Posts: 57
I think I got it this time. Of course I said that last time, and I wasn't even close. Take another look.

Attached are the source and dll files along with a marked up chart of the SPX with the indicator on it.
Date Time Of Last Edit: 2013-11-03 19:20:35
attachmentTD_Studies.cpp - Attached On 2013-11-03 19:20:07 UTC - Size: 1.44 KB - 711 views
attachmentTD_Studies.dll - Attached On 2013-11-03 19:20:12 UTC - Size: 13 KB - 631 views
imageChart1.png / V - Attached On 2013-11-03 19:20:20 UTC - Size: 86.25 KB - 547 views
[2013-11-03 20:27:58]
kona808 - Posts: 12
Hi. Awesome. Looks great so far.

Thanks again! I've gotta figure out how to get this coding stuff better.


[2013-11-03 21:14:21]
kona808 - Posts: 12
One other quick question if anyone sees this:

I'm also looking to code a few VERY basic entry signals (that are used in concert with other indicators - i.e. these are "confirmations"). There are five in total, but I think if I had the code for one of them (or even the "intro" part of the code) I would be capable of adjusting or adapting for the other four (they are very basic).

Example of one:

TD Camoflage Sell Signal:
1. The close of current price bar must be above the close of previous price bar.
2. The close of current price bar must be below the open of the current price bar open, and
3. The high of the current price bar high must be above the true high two price bars earlier.

Eg. 2:

TD Clop Sell Signal (sell again):
1. Downside momentum must continue when the market exceeds the open and close price of the prior bar
2. The open of the current bar must be above the close of previous price bar and open, and
3. The market must subsequently trade below both the open and close of the previous price bar.

...

There are a couple others I can provide if anyone is interested (reversal confirmations basically), although from the coding side they all are similar - they reference up to 2 or 3 price bars in the past, and are based on high/low/open/closing prices.

A sell or buy arrow (down or up) would be used.

Any thoughts would be awesome. I appreciate support and if anyone wants the other conditions happy to provide.


To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account