Login Page - Create Account

Support Board


Date/Time: Sat, 11 May 2024 22:28:13 +0000



[Programming Help] - SumAllChartsBar SumChartsFromList questions

View Count: 399

[2020-10-13 04:02:30]
jomo88 - Posts: 47
1) In Studies6.cpp, the study SumAllChartsBar, line 100:

for (int SubgraphIndex = 0; SubgraphIndex < 6; SubgraphIndex++)

Why 6? Aren't there 11 subgraphs to loop through? Along the same line of questioning...

2) In Studies6.cpp, the study SumChartsFromList, line 426:

for (int SubgraphIndex = 0; SubgraphIndex <= SC_LAST; SubgraphIndex++)

I don't see how SC_LAST could even make sense being used here. Is this an error? In SumAllChartsBar it was 6, and here it is SC_LAST. Can you give some clarification behind the logic in both cases? Thank you.
[2020-10-14 05:09:53]
jomo88 - Posts: 47
I understand now...

1) None of these studies fill sc.Subgraph[9] or sc.Subgraph[10], the BidVol and AskVol. Also, sc.CalculateOHLCAverages(DataIndex) was handling the 'Avg' subgraphs calculations.

2) SC_LAST is equal to 3 in sc.Subgraph[3]

One last question - lines 441 to 451 in Studies6.cpp, aren't these lines redundant? Wouldn't the high already be the max of the OHLC? Thanks

sc.Subgraph[ SC_HIGH][DataIndex] = max(sc.Subgraph[SC_OPEN][DataIndex],
max(sc.Subgraph[SC_HIGH][DataIndex],
max(sc.Subgraph[SC_LOW][DataIndex],sc.Subgraph[SC_LAST][DataIndex])
)
);

sc.Subgraph[SC_LOW][DataIndex] = min(sc.Subgraph[SC_OPEN][DataIndex],
min(sc.Subgraph[SC_HIGH][DataIndex],
min(sc.Subgraph[SC_LOW][DataIndex],sc.Subgraph[SC_LAST][DataIndex])
)
);

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

Login

Login Page - Create Account