Support Board
Date/Time: Thu, 23 Jan 2025 03:12:40 +0000
Post From: Converting NT8 Opening Range Volume Breakout Study
[2018-11-01 18:58:51] |
Yoda - Posts: 106 |
I found an opening range volume breakout study here: http://traders.com/Documentation/FEEDbk_docs/2017/06/TradersTips.html They have provided code for 9 different charting programs, but unfortunately Sierra Chart is not included. So I've started to convert the provided NT8 code to SC by first focusing on the cumulative & average volume sections. My code compiles without any issues and correctly calculates the cumulative overnight volume. However, the code does not add up the total overnight volume for five days. Specifically this section: // Build NightlyVolumes - Hardcoded 5 days.
for(int i = 0; i < 5; i++) { if (NightlyVolumes[i] == 5 - 1) { NightlyVolumes[i] = NightlyVolume; DebugString.Format("NightlyVolumes[%d] >= SessionStart: \ %f",i, NightlyVolumes[i]); sc.AddMessageToLog(DebugString, 0); } else { NightlyVolumes[i] = NightlyVolumes[i + 1]; DebugString.Format("NightlyVolumes[%d] at SessionStart: \ %f", i, NightlyVolumes[i]); sc.AddMessageToLog(DebugString, 0); } } I'm guessing that I haven't setup NightlyVolumes correctly. I've tried a number of things, including: std::array<int,5> NightlyVolumes; // Create Array of 5 days
and also: SCFloatArrayRef NightlyVolumes = sc.Subgraph[9].Arrays[0];
But nothing I did worked. I've attached my code and should be grateful if someone would have a look at it and let me know what changes I need to make. |
ORVB-0-v01a-20181101-1203.cpp - Attached On 2018-11-01 18:54:13 UTC - Size: 5.24 KB - 358 views |