What to do when Data window shows different value then the iCustom value?
What to do when Data window shows different value then the iCustom value?
Loading saved threads...
Umer · External communityPost link
External question — Stack Overflow Stack Exchange
Author: Umer
Original post: https://stackoverflow.com/questions/67112551
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
Can someone please give me some pointers/advice on what to do when the data window shows different value then the iCustom value ?
Example :
Buffer 0
and
buffer 1
are showing correct values but
buffer 3 and buffer 2
are showing wrong values
Code:
#property version "1.10"
#property strict
int handle;
//+------------------------------------------------------------------+
//| Initialization function of the expert |
//+------------------------------------------------------------------+
int OnInit()
{
handle=iCustom(_Symbol, 0, "LTD by KDMfx");
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Deinitialization function of the expert |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
IndicatorRelease(handle);
}
void OnTick()
{
double LTDindicator1[],
LTDindicator2[],
LTDindicator3[],
LTDindicator4[];
ArraySetAsSeries(LTDindicator1, true);
ArraySetAsSeries(LTDindicator2, true);
ArraySetAsSeries(LTDindicator3, true);
ArraySetAsSeries(LTDindicator4, true);
CopyBuffer(handle, 0, 0, 75, LTDindicator1);
CopyBuffer(handle, 1, 0, 75, LTDindicator2);
CopyBuffer(handle, 2, 0, 75, LTDindicator3);
CopyBuffer(handle, 3, 0, 75, LTDindicator4);
double val1= LTDindicator1[5] ;
double val2= LTDindicator2[5] ;
double val3= LTDindicator3[5] ;
double val4= LTDindicator4[5] ;
Comment(
"\nBuffer 0: " , val1,
"\nBuffer 1: " , val2,
"\nBuffer 2: " , val3,
"\nBuffer 3: " , val4
);
return;
}
Quote
Report
Post Reply
Checking account access…