Support Board
Date/Time: Tue, 04 Mar 2025 21:21:28 +0000
[Programming Help] - sc.Parabolic() ~ ACSIL
View Count: 752
[2022-01-03 17:35:00] |
User882482 - Posts: 4 |
Attached is a chart showing Parabolic SAR applied to a Moving Average. (attached is a chart) How do you apply a Parabolic to a Moving Average in ACSIL ? Current code with SC.Parabolic() example included: #include "sierrachart.h" SCDLLName("PSAR_MA") SCSFExport scsf_PSAR(SCStudyInterfaceRef sc) { // SCSubgraphRef Subgraph_Parabolic = sc.Subgraph[0]; SCSubgraphRef RL10_Parabolic = sc.Subgraph[1]; SCSubgraphRef RL_10 = sc.Subgraph[2]; SCInputRef Input_InputDataHigh = sc.Input[0]; SCInputRef Input_InputDataLow = sc.Input[1]; SCInputRef Input_StartAccelerationFactor = sc.Input[2]; SCInputRef Input_AccelerationIncrement = sc.Input[3]; SCInputRef Input_MaxAccelerationFactor = sc.Input[4]; SCInputRef Input_AdjustForGap = sc.Input[5]; SCInputRef RL_10Period = sc.Input[6]; if (sc.SetDefaults) { // Set the sub-graph configuration and defaults sc.GraphName = "PSAR"; sc.StudyDescription = "Parabolic Stop and Reverse applied to a MA not price"; sc.DrawZeros = false; sc.GraphRegion = 0; sc.ValueFormat = VALUEFORMAT_INHERITED; sc.AutoLoop = 1; /* Subgraph_Parabolic.Name = "Parabolic"; Subgraph_Parabolic.DrawStyle = DRAWSTYLE_POINT; Subgraph_Parabolic.LineWidth = 3; Subgraph_Parabolic.PrimaryColor = RGB(0,0,0); */ RL10_Parabolic.Name = "RL10 Parabolic"; RL10_Parabolic.DrawStyle = DRAWSTYLE_POINT; RL10_Parabolic.LineWidth = 3; RL10_Parabolic.PrimaryColor = RGB(0,0,255); Input_InputDataHigh.Name = "Input Data High"; Input_InputDataHigh.SetInputDataIndex(SC_HIGH); Input_InputDataLow.Name = "Input Data Low"; Input_InputDataLow.SetInputDataIndex(SC_LOW); Input_StartAccelerationFactor.Name = "Start Acceleration Factor"; Input_StartAccelerationFactor.SetFloat(0.02f); Input_StartAccelerationFactor.SetFloatLimits(0.000001f,(float)MAX_STUDY_LENGTH); Input_AccelerationIncrement.Name = "Acceleration Increment"; Input_AccelerationIncrement.SetFloat(0.12f); Input_AccelerationIncrement.SetFloatLimits(0.00001f, 100.0f); Input_MaxAccelerationFactor.Name = "Max Acceleration Factor"; Input_MaxAccelerationFactor.SetFloat(0.2f); Input_MaxAccelerationFactor.SetFloatLimits(0.000001f,(float)MAX_STUDY_LENGTH); Input_AdjustForGap.Name = "Adjust for Gap"; Input_AdjustForGap.SetYesNo(0); // No RL_10Period.Name = "RL10 Period"; RL_10Period.SetInt(10); return; } // Calculate RL MA sc.DataStartIndex = 1 ; sc.MovingAverage( sc.BaseDataIn[SC_LAST], RL_10, MOVAVGTYPE_LINEARREGRESSION, RL_10Period.GetInt()); ///// Parabolic applied to a moving average as per Chart Setup.JPG sc.Parabolic( RL_10, sc.BaseDateTimeIn, RL10_Parabolic, sc.Index, Input_StartAccelerationFactor.GetFloat(), Input_AccelerationIncrement.GetFloat(), Input_MaxAccelerationFactor.GetFloat(), Input_AdjustForGap.GetYesNo(), Input_InputDataHigh.GetInputDataIndex(), Input_InputDataLow.GetInputDataIndex() ); } The standard SC Parabolic function is as follows: */////////////////////////// Standard Sierra Chart Parabolic code as an example sc.Parabolic( sc.BaseDataIn, sc.BaseDateTimeIn, Subgraph_Parabolic, sc.Index, Input_StartAccelerationFactor.GetFloat(), Input_AccelerationIncrement.GetFloat(), Input_MaxAccelerationFactor.GetFloat(), Input_AdjustForGap.GetYesNo(), Input_InputDataHigh.GetInputDataIndex(), Input_InputDataLow.GetInputDataIndex() ); /*/////////////////////////// Standard Sierra Chart Parabolic code as an example There must be something very simple I am missing ? Thank you for your help Date Time Of Last Edit: 2022-01-08 16:06:05
|
![]() ![]() |
[2022-01-06 11:30:17] |
User882482 - Posts: 4 |
How does ACSIL pass the "Based On:" setting/input to a Sierra Chart function? Chart Studies: Settings and Inputs Tab >> Based On - Basing a Study on Another Study 3. Select from the Based On list the study to base the study that the Study Settings window is open for, on. Only studies which are already added to the Studies to Graph list on the Chart Studies window will be listed. It is necessary for a study to be in that list in order to base a study on it. If you want to base a study on the main price graph, then select <Main Price Graph>.
4. When you base a study on another study, then the inputs named Input Data will list the Subgraphs of the study you are basing your study on. After setting Based On, you will need to choose the appropriate Subgraph listed in these Input Data inputs. This is especially important when basing a study that normally is based on the main price graph and refers to Open, High, Low, or Close/Last values from that main price graph. Those Input Data Inputs now need to refer to the appropriate Study Subgraphs it is based on. Date Time Of Last Edit: 2022-02-01 07:38:01
|
![]() |
To post a message in this thread, you need to log in with your Sierra Chart account: