Login Page - Create Account

Support Board


Date/Time: Sun, 29 Dec 2024 16:10:08 +0000



Post From: compiler error

[2016-01-22 18:06:24]
jivetrader - Posts: 410
-- Starting build of Custom Studies Source files: ehlers_b1.cpp. -- 13:05:50

"C:\SierraChart\CPPCompiler\bin\g++.exe" "C:\SierraChart\ACS_Source\ehlers_b1.cpp" -march=i686 -mtune=i686 -O2 -shared -static -static-libgcc -static-libstdc++ -s -fno-rtti -fno-exceptions -std=gnu++11 -o "C:\SierraChart\Data\ehlers_b1.dll"

C:\SierraChart\ACS_Source\ehlers_b1.cpp:7:10: error: expected constructor, destructor, or type conversion before '(' token
SCDLLInit("ehlers#1");
^
-- End of Build -- 13:05:51



STUDY CODE:

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <math.h>
#include "sierrachart.h"


SCDLLInit("ehlers#1");
SCDLLName("ehlers#1")

SCSFExport scsf_ehlers(SCStudyInterfaceRef sc)
{
  SCSubgraphRef Ehlers     = sc.Subgraph[0];
  SCSubgraphRef Mid       = sc.Subgraph[1];

  if (sc.SetDefaults)
  {
    sc.GraphName       = "ehlers#1";
    sc.StudyDescription   = "ehlers#1 >> beta 1<< @ganz";

    Ehlers.Name       = "ehlers#1";
    Ehlers.DrawStyle     = DRAWSTYLE_LINE;
    Ehlers.PrimaryColor     = RGB(255,255,0);
    Ehlers.LineWidth     = 2;
    
    sc.GraphRegion       = 1;
    sc.ValueFormat       = 2;
    sc.AutoLoop       = 1;
    sc.FreeDLL         = 0;
    
    return;
  }
  
  float a1, b1, c1, c2, c3;
  
  a1 = exp( (-1.414) *3.14159/10);
  
  b1 = 2*a1*cos(1.414*(180*3.14159/180)/10);
  
  c2 = b1;
  
  c3 = (-1)*a1*a1;
  
  c1 = 1- c2 - c3;
  
  // Ehlers[sc.Index] = c1*(sc.BaseDataIn[SC_LAST][sc.Index] + sc.BaseDataIn[SC_LAST][sc.Index-2] )/2 +c2*Ehlers[sc.Index]+c3*Ehlers[sc.Index];
      
  float al, tr, fi;
  
  tr = 360*3.14159/180;
  fi = 0.707*tr/48;
  
  al = (cos(fi) + sin(fi) - 1)/cos(fi);
  
  Mid[sc.Index] = (1-al/2)*(1-al/2)*(sc.BaseDataIn[SC_LAST][sc.Index]-2*sc.BaseDataIn[SC_LAST][sc.Index-1]+sc.BaseDataIn[SC_LAST][sc.Index-2])+2*(1-al)*Mid[sc.Index-1] - (1-al)*(1-al)*Mid[sc.Index-2];
  
  Ehlers[sc.Index] = c1*(Mid[sc.Index] +Mid[sc.Index-1] )/2 +c2*Ehlers[sc.Index-1]+c3*Ehlers[sc.Index-2];
      
}