Login Page - Create Account

Support Board


Date/Time: Tue, 30 Apr 2024 18:03:14 +0000



[Programming Help] - Problem to put one value for each bar in the "DRAWSTYLE_VALUE_ON_HIGH"

View Count: 691

[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"
[2017-01-17 09:10:52]
User210074 - Posts: 63
I forgot the error

-- Starting build of Custom Studies Source files: CDLSPE.cpp. -- 09:00:31

C:\WINDOWS\system32\cmd.exe /C "C:\SierraChart\ACS_Source\VisualCCompile.Bat"


C:\SierraChart\ACS_Source>call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
CDLSPE.cpp
C:\SierraChart\ACS_Source\CDLSPE.cpp(35): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
Creating library CDLSPE.lib and object CDLSPE.exp
Generating code
Finished generating code
-- End of Build -- 09:00:33

[2017-01-17 09:19:59]
Sierra Chart Engineering - Posts: 104368
This is just a warning and not an error message. Looks like the building of the DLL was successful.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account