Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 19:16:05 +0000



[User Discussion] - cumulative delta and price bar divergence

View Count: 6727

[2013-12-06 15:37:10]
User31737 - Posts: 73
I am trying to figure out how to integrate a basic signal that would highlight the up bar/down bar divergence between cumulative delta bars and main price chart ( I use tick or volume bars primarily)
To explain the simple divergence I am looking at:
assuming up candles are colored blue and down candles are colored red, I want to see when the cumulative delta bar is blue, and the main price candle is red
and the opposite, when the CDB is red and price candle is blue, and then draw a simple graphic(dot, star, arrow, etc) on the main price chart to highlight this divergence.

I have looked at the delta divergence study, but I want to use the cumulative delta study that resets at beginning of trading day, not the lookback based approach in the provided study.
Tomgilb? this sounds right up your alley
any suggestions/help from anyone would be truly appreciated thanks
[2013-12-06 21:41:25]
Zosimus - Posts: 345
Here is a simple ACSIL code that I wrote that does what you want (If I understood you correctly).
It draws a Down Arrow above a positive bar that has a negative delta and an Up Arrow below a negative bar that has a positive delta.

If you also want to have a sound alert then enter "1" for "SoundAlert" in the Setting and Inputs. Use the Subgraps tab to configure the colors and width/size of the Arrows.

Regarding the sound alert - the study uses alert #7 for the Positive bar/Negative delta signal and alert #8 for the opposite signal. You can configure those alerts at the Global Settings >> General Settings.

Please take the time to check and make sure that this study behaves exactly like you want it to.
I am not a professional programmer and I am sure that there are better ways to write this but it works.

Enjoy.

I am attaching the .cpp file so that you will be able to build it on your SC Version.

If you need help with building:
Save the file at the ACS_Source folder within your SierraChart folder. After this go to Analysis >>> Build Custom Studies DLL, click "Select File" and choose this study from the list. then click the "Build Custom Studies DLL button". Wait a few seconds until you see the message "End of Build". Now you can close this compiler window and find the study in the Advanced studies list.
[2013-12-06 21:45:34]
Zosimus - Posts: 345
Looks like the file didn't upload, let me try again.
[2013-12-06 21:47:08]
Zosimus - Posts: 345

Date Time Of Last Edit: 2013-12-06 23:15:37
[2013-12-06 22:20:11]
Sierra Chart Engineering - Posts: 104368
Here are the instructions to attach a file:
https://www.sierrachart.com/index.php?l=PostingInformation.php#AttachFile

Did you attach the file according to the instructions? There should not be a problem with this.
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
[2013-12-06 22:31:21]
Zosimus - Posts: 345
Thanks SC Support team, I am trying to upload again.
[2013-12-06 22:33:03]
Zosimus - Posts: 345
ok, the upload still doesn't work. The strange thing is that when I look at the Preview before submitting I do see the uploaded file but after submitting the files disappears.
[2013-12-06 22:42:22]
Zosimus - Posts: 345

Date Time Of Last Edit: 2013-12-07 10:51:23
[2013-12-06 22:42:38]
Zosimus - Posts: 345

Date Time Of Last Edit: 2013-12-07 10:51:38
[2013-12-06 22:44:57]
Zosimus - Posts: 345

Date Time Of Last Edit: 2013-12-07 10:52:54
[2013-12-06 22:59:34]
Sierra Chart Engineering - Posts: 104368
OK, this gives us a clue to what to look for:
ok, the upload still doesn't work. The strange thing is that when I look at the Preview before submitting I do see the uploaded file but after submitting the files disappears.

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
[2013-12-06 23:15:10]
Zosimus - Posts: 345
SC Team, the upload worked just fine. It was my mistake and I apologize for wasting your time on this. After selecting the file and hitting the UPLOAD button I closed the uploading popup window before hitting the Submit New Reply button.
[2013-12-07 09:16:34]
Zosimus - Posts: 345
IMPORTANT !, There was a small bug in the version of the study that I posted here before. Please do not use it. Instead I am posting here the fixed code. Please use only this fixed code.
[2013-12-07 09:17:33]
Zosimus - Posts: 345
Here is the fixed file.
attachmentDelDivatBar.cpp - Attached On 2013-12-07 09:17:28 UTC - Size: 1.79 KB - 779 views
[2013-12-08 21:29:34]
User31737 - Posts: 73
thank you Yon I will try this file and let you know... I really appreciate the help. Thank you, too SC support, you guys are always great.
[2013-12-08 22:05:23]
User31737 - Posts: 73
thank you Yon for the file and the accompanying directions about the build study. I have it on the chart and it works. Now it needs a filter.

Is there a way to have the arrow display conditional on whether the price bar is either a relative new Hi or Lo?

example:
if Hi of price bar(the one that is having the divergence) is > or = Highest Hi of last N bars OR
if Lo of price bar is < or = to Lowest Lo of last N bars

then draw signal

where the period N for look back could be entered as a number?
[2013-12-09 01:03:33]
Zosimus - Posts: 345
Hi User31737,
I am uploading here the study with the addition of the filter you asked . I checked it and it seems to work fine but please check it carefully again because it is 3 am over here and my concentration is poor :-)
attachmentDelDivatBar_1.cpp - Attached On 2013-12-09 01:03:28 UTC - Size: 2.39 KB - 780 views
[2013-12-09 18:34:42]
User31737 - Posts: 73
Thank you Yon, I will check it out after the am trade. Thank you tons for the help!
[2013-12-09 18:45:15]
Zosimus - Posts: 345
:-)
[2019-04-20 23:53:55]
User770116 - Posts: 6
Hello yon, is there a way I can have the candles outline highlighted instead of having arrows pointing at it? Either way thanks for your indicator.
[2020-09-10 03:38:11]
Ed C. - Posts: 98
Has this study been modified for more recent versions of SC? It won't compile on version 2124:

-- Starting build of Custom Studies Source files: DelDivatBar_1.cpp. -- 22:37:41

C:\WINDOWS\system32\cmd.exe /C "C:\SierraChart\SierraChartTransActMA\ACS_Source\VisualCCompile.Bat"


C:\SierraChart\SierraChartTransActMA\ACS_Source>call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
cl : Command line warning D9002 : ignoring unknown option '/std:c++17'
DelDivatBar_1.cpp
C:\SierraChart\SierraChartTransActMA\ACS_Source\DelDivatBar_1.cpp(59): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\SierraChart\SierraChartTransActMA\ACS_Source\DelDivatBar_1.cpp(60): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\SierraChart\SierraChartTransActMA\ACS_Source\DelDivatBar_1.cpp(64): error C2039: 'PersistVars': is not a member of 's_sc'
c:\sierrachart\sierracharttransactma\acs_source\sierrachart.h(32): note: see declaration of 's_sc'
C:\SierraChart\SierraChartTransActMA\ACS_Source\DelDivatBar_1.cpp(64): error C2227: left of '->i1' must point to class/struct/union/generic type
C:\SierraChart\SierraChartTransActMA\ACS_Source\DelDivatBar_1.cpp(64): error C2530: 'TopCondition': references must be initialized
C:\SierraChart\SierraChartTransActMA\ACS_Source\DelDivatBar_1.cpp(65): error C2039: 'PersistVars': is not a member of 's_sc'
c:\sierrachart\sierracharttransactma\acs_source\sierrachart.h(32): note: see declaration of 's_sc'
C:\SierraChart\SierraChartTransActMA\ACS_Source\DelDivatBar_1.cpp(65): error C2227: left of '->i2' must point to class/struct/union/generic type
C:\SierraChart\SierraChartTransActMA\ACS_Source\DelDivatBar_1.cpp(65): error C2530: 'BotCondition': references must be initialized
-- End of Build -- 22:37:44
[2020-09-10 03:59:13]
Ed C. - Posts: 98
Never mind - I fixed it :)

See attached.
attachmentDelDivatBar_1.cpp - Attached On 2020-09-10 03:59:08 UTC - Size: 2.4 KB - 556 views

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

Login

Login Page - Create Account