Login Page - Create Account

Support Board


Date/Time: Tue, 21 May 2024 15:56:16 +0000



Post From: Problem to put one value for each bar in the "DRAWSTYLE_VALUE_ON_HIGH"

[2017-01-17 08:08:14]
User210074 - Posts: 63

#include <windows.h>
#include <math.h>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include "sierrachart.h"
using namespace std;
SCDLLName("CDLSPE")
double RoundTo( double Price){double Ra = round(Price * 100);double Rb = Ra/100;return Rb;}//round price
double ColorCDLSPE(double OP, double CL){
double Res = CL-OP;
    if(Res>0){double Bg = 1;return Bg;}
    else if(Res == 0){double Bg = 0;return Bg;}
    else{double Bg = -1;return Bg;}
}//end of ColorBg
SCSFExport scsf_CDLSPE(SCStudyInterfaceRef sc) {
int BarIndex = sc.Index;
double SPA = sc.High[BarIndex];double SPB = sc.Low[BarIndex];double SPC = sc.Open[BarIndex];double SPD = sc.Close[BarIndex];double O = RoundTo(SPC);double C = RoundTo(SPD);
SCSubgraphRef Type = sc.Subgraph[0];
if (sc.SetDefaults){
    sc.GraphName = "Bougie";
    sc.GraphRegion = 0;
    sc.AutoLoop = true;
sc.FreeDLL = 1;
    
    Type.Name= "Type de bougie";
    Type.DrawStyle = DRAWSTYLE_VALUE_ON_HIGH;
    Type.LineWidth = 1;
    Type.PrimaryColor = RGB(0,128,255);
    Type.DrawZeros = true;
    Type.GraphicalDisplacement= 1;
    return;
   }//end of defaults
double BG = ColorCDLSPE(O,C);
Type[BarIndex] = BG;//<--- probleme here
}//end of CDLSPE

Here, is the error message that I have in the "BUILD CUSTOM STUDY DLL"