Login Page - Create Account

Support Board


Date/Time: Sun, 24 Nov 2024 06:48:16 +0000



Post From: inv reference type question

[2013-09-17 19:42:12]
gabby alindogan - Posts: 49
The code you detailed plots the highest high past 10 days BUT does not offset by 1 bar i.e. sc.index-1. The indicator needs to plot the highest high past 10 bars excluding the current bar which is still in process of completing.

I tried to change your line by adding an offset and I got errors.

Orig> float HighestxBB = sc.GetHighest(sc.BaseData[SC_HIGH], 10);

Changed to > float HighestxBB = sc.GetHighest(sc.BaseData[SC_HIGH][sc.Index-1], 10);

Error log follows

C:\SierraChart\ACS_Source\Fx.cpp: In function 'void scsf_CapPoints(SCStudyInterfaceRef)':
C:\SierraChart\ACS_Source\Fx.cpp:47:72: error: no matching function for call to 's_sc::GetHighest(float&, int)'
float HighestxBB = sc.GetHighest(sc.BaseData[SC_HIGH][sc.Index-1], 10);
^
C:\SierraChart\ACS_Source\Fx.cpp:47:72: note: candidates are:
In file included from C:\SierraChart\ACS_Source\Fx.cpp:2:0:
C:\SierraChart\ACS_Source\sierrachart.h:3008:8: note: float s_sc::GetHighest(SCFloatArrayRef, int, int)
float GetHighest(SCFloatArrayRef In, int Index, int Length)
^
C:\SierraChart\ACS_Source\sierrachart.h:3008:8: note: candidate expects 3 arguments, 2 provided
C:\SierraChart\ACS_Source\sierrachart.h:3025:8: note: float s_sc::GetHighest(SCFloatArrayRef, int)
float GetHighest(SCFloatArrayRef In, int Length)
^
C:\SierraChart\ACS_Source\sierrachart.h:3025:8: note: no known conversion for argument 1 from 'float' to 'SCFloatArrayRef {aka c_ArrayWrapper<float>&}'
-- End of Build -- 15:39:54