#15 Postby hjabu » Mon May 02, 2011 1:00 pm
I have created another code , and almost done but i have no idea, on eror
" IF ", Please anyone has answer how to resolve this, my code as shown below,:
//---------------------------------------------------------------------------
// THV SDX-TzPivots_v4.9
//---------------------------------------------------------------------------
library THVSDXTzPivots;
{ #property copyright "Copyright Shimodax"
#property link "http://www.strategybuilderfx.com" }
uses
SysUtils,
classes,
graphics,
math,
DateUtils,
IndicatorInterfaceUnit,
TechnicalFunctions in 'TechnicalFunctions.pas';
var
Local__HrsServerTzFromGMT: integer = 0;
Destination__HrsNewTZfromGMT: integer = 0;
Show_1Daily_2FibonacciPivots: integer = 2;
FullScreenLines: boolean = FALSE;
__withMarginPrices: boolean = TRUE;
MoveLabels_LR_DecrIncr: integer = 0;
Relabeler_Adjustment: integer = 10;
Show_Relabeler_Comment: boolean = FALSE;
Show_Data_Comment: boolean = FALSE;
//---------------------------------------------------------------------------
// Initialization
//---------------------------------------------------------------------------
procedure Init; stdcall;
begin
// define parameters
IndicatorShortName('THVSDXTzPivots');
SetOutputWindow(ow_ChartWindow);
RegOption('Pivot Type', ot_EnumType, PivotType);
AddOptionValue('Pivot Type', 'Daily');
RegOption('YesterdayHighLowColor',ot_EnumType,yesterdayHighColor);
AddOptionValue('HighLowLineType','HighLowLineStyle_01234');
AddOptionValue('HighLowSolidLineType','HighLowSolidLineThickness');
AddOtionValue('ShowYesterdayType','ShowYesterdayHighLow');
RegOption('TodayOpenColor',ot_EnumType,TodayOpenColor);
AddOptionValue('TodayOpenLineType','OpenLineStyle_01234');
AddOptionValue('TodayOpenType','TodayOpenSolidLineThickness');
AddOptionValue('ShowTodayType','ShowTodayOpen');
RegOption('CamarillaColor',ot_EnumType,CamarillaColor);
AddOptionValue('CamarillaLineType','CamarillaLineStyle_01234');
AddOptionValue('CamarillaSolidLineType','CamarillaSolidLineThickness');
AddOptionValue('ShowCamarillaType','ShowCamarilla');
RegOption('PeriodSeparatorLinesColor',ot_EnumType,PeriodSeparatorLinesColor);
AddOptionValue('SeparatorLinesType','SeparatorLinesStyle_01234');
AddOptionValue('SeparatorLinesType','SeparatorLinesThickness');
AddOptionValue('ShowPeriodType','ShowPeriodSeparatorLines');
RegOption('PeriodSeparatorsLabelsColor',ot_EnumType,PeriodSeparatorsLabelsColor);
AddOptionValue('PlaceAtType','PlaceAt_TopBot_12_OfChart');
AddOptionValue('SeparatorLabelType','SeparatorLabelFontSize');
AddOptionValue('_Label_Norm_Type','_Label_Norm_Bold_Black_123');
AddOptionValue('ShowPeriodType','ShowPeriodSeparatorLabels');
RegOption('PivotLinesLabelColor',ot_EnumType,PivotLinesLabelColor);
AddOptionValue('LineLabelsType','LineLabelsFontSize');
AddOptionValue('L_Label_Type','L_Label_Norm_Bold_Black_123T');
AddOptionValue('LineLabelsType','LineLabelsIncludePrice');
// create index buffers
MidPivot := CreateIndexBuffer;
QtrPivot := CreateIndexBuffer;
R1 := CreateIndexBuffer;
R2 := CreateIndexBuffer;
R3 := CreateIndexBuffer;
R4 := CreateIndexBuffer;
R5 := CreateIndexBuffer;
S1 := CreateIndexBuffer;
S2 := CreateIndexBuffer;
S3 := CreateIndexBuffer;
S4 := CreateIndexBuffer;
S5 := CreateIndexBuffer;
CentralPivot := CreateIndexBuffer;
YesterdayHighLowColor := CreateIndexBuffer;
TodayOpenColor := CreateIndexBuffer;
Camarilla := CreateIndexBuffer;
PeriodSeparatorLines := CreateIndexBuffer;
PivotLinesLabel := CreateIndexBuffer;
IndicatorBuffers(18);
SetIndexBuffer(0, R5);
SetIndexStyle(0, ds_Line, psSolid, 1, clFireBrick);
SetIndexLabel(0, 'R5');
SetIndexBuffer(0, R4);
SetIndexStyle(0, ds_Line, psSolid, 1, clFireBrick);
SetIndexLabel(0, 'R4');
SetIndexBuffer(0, R3);
SetIndexStyle(0, ds_Line, psSolid, 1, clFireBrick);
SetIndexLabel(0, 'R3');
SetIndexBuffer(0, R2);
SetIndexStyle(0, ds_Line, psSolid, 1, clFireBrick);
SetIndexLabel(0, 'R2');
SetIndexBuffer(0, R1);
SetIndexStyle(0, ds_Line, psSolid, 1, clFireBrick);
SetIndexLabel(0, 'R1');
SetIndexBuffer(0, CentralPivot);
SetIndexStyle(0, ds_Line, psSolid, 1, clC0x00_0x62_0x62);
SetIndexLabel(0, 'CentralPivot');
SetIndexBuffer(0, MidPivot);
SetIndexStyle(0, ds_Line, psSolid, 1, clC0x62_0X62_0X00);
SetIndexLabel(0, 'MidPivot');
SetIndexBuffer(0, QtrP);
SetIndexStyle(0, ds_Line, psSolid, 1, clC0x62_0X62_0X00);
SetIndexLabel(0, 'QtrP')
SetIndexBuffer(0, S1);
SetIndexStyle(0, ds_Line, psSolid, 1, clDarkGreen);
SetIndexLabel(0, 'S1');
SetIndexBuffer(0, S2);
SetIndexStyle(0, ds_Line, psSolid, 1, clGreen);
SetIndexLabel(0, 'S2');
SetIndexBuffer(0, S3);
SetIndexStyle(0, ds_Line, psSolid, 1, clForestGreen);
SetIndexLabel(0, 'S3');
SetIndexBuffer(0, S4);
SetIndexStyle(0, ds_Line, psSolid, 1, clForestGreen);
SetIndexLabel(0, 'S4');
SetIndexBuffer(0, S5);
SetIndexStyle(0, ds_Line, psSolid, 1, clForestGreen);
SetIndexLabel(0, 'S5');
SetIndexBuffer(0, CentralPivot);
SetIndexStyle(0, ds_Line, psSolid, 1, clC0x00_0x62_0x62);
SetIndexLabel(0, 'CentralPivot');
SetIndexBuffer(0, YesterdayHighLow);
SetIndexStyle(0, ds_Line, psSolid, 1, clC0x49_0x49_0x49);
SetIndexLabel(0, 'YesterdayHighLow');
SetIndexBuffer(0, TodayOpen);
SetIndexStyle(0, ds_Line, psSolid, 1, clC0x71_0x00_0x71);
SetIndexLabel(0, 'TodayOpen');
SetIndexBuffer(0, Camarilla);
SetIndexStyle(0, ds_Line, psSolid, 1, clOrchid);
SetIndexLabel(0, 'Camarilla');
SetIndexBuffer(0, PeriodSeparatorLines);
SetIndexStyle(0, ds_Line, psSolid, 1, clC0x62_0x62_0x00);
SetIndexLabel(0, 'PeriodSeparatorLines');
SetIndexBuffer(0, PivotLinesLabel);
SetIndexStyle(0, ds_Line, psSolid, 1, clC0x62_0x62_0x00);
SetIndexLabel(0, 'PivotLinesLabel');
end;
//---------------------------------------------------------------------------
// Deinitialization
//---------------------------------------------------------------------------
procedure Done; stdcall;
begin
//
end;
//---------------------------------------------------------------------------
// Calculate bar
//---------------------------------------------------------------------------
procedure Calculate(index: integer); stdcall;
var
integer: gi_392;
integer: gi_396 = 0;
integer: gi_400 = 0;
integer: init()
if (Ask > 10.0) EROR on EXPECTED on "IF " words
gi_392 = 2;
integer: gi_392 = 4;
Print("Period= ", Period());
exports
Init, Done, Calculate;
begin
end.