Re: Coding Help

232
wojtek wrote: Fri May 05, 2017 3:40 am Yes, thank you! I'm trying to do such a thing

Code: Select all

HistoUp[i] = EMPTY_VALUE; HistoDn[i] = EMPTY_VALUE;
if (A < B) {HisotUp[i] = 1; HistoDn[i] = EMPTY_VALUE;}
if (A > B) {HistoDn[i] = 1; HistoUp[i] = EMPTY_VALUE;}
but it doesn't work... :-(
It should work
You have to check the rest of your code, since that code block is OK

Re: Coding Help

234
Dearest Mladen,
We are facing a problem with "iCustom" for ptl 2_2.mq4 indicator ... The problem appears with the parameter
"extern enDisplay DisplayWhat = dis_line; // Display type" ... the iCustom is written as follows :
iCustom(NULL,0,"ptl 2_2",
TimeFrame,SlowPipDisplace,FastLength,FastPipDisplace,false,false,false,false,false,dis_line,Interpolate,0,i);
Could you please give us your correcting suggestion ?????
Thank you in advance as always.
Best Regards
Dimitri


Re: Coding Help

236
wojtek wrote: Sat May 06, 2017 11:12 pm I suppose you should write 1 instead of 'dis_line',
because that (listing) variable is an integer type (with 0).
Dear wojtek, thank you for your kind reply. I have followed your instruction but the result is not achieving requested operation.
Waiting for additional help ... Thank you anyway ....
Best Regards
Dimitri

Re: Coding Help

237
Dimitri wrote: Sat May 06, 2017 9:56 pm Dearest Mladen,
We are facing a problem with "iCustom" for ptl 2_2.mq4 indicator ... The problem appears with the parameter
"extern enDisplay DisplayWhat = dis_line; // Display type" ... the iCustom is written as follows :
iCustom(NULL,0,"ptl 2_2",
TimeFrame,SlowPipDisplace,FastLength,FastPipDisplace,false,false,false,false,false,dis_line,Interpolate,0,i);
Could you please give us your correcting suggestion ?????
Thank you in advance as always.
Best Regards
Dimitri
You have to include the enum (the enDisplay) in the code somewhere and it should work OK then

Re: Coding Help

238
mladen wrote: Sat May 06, 2017 11:38 pm You have to include the enum (the enDisplay) in the code somewhere and it should work OK then
Dear Mladen,
Thank you for your kind reply ....
Just to clarify if it is well understood ....

I have to copy & paste following part of the code ...

enum enDisplay
{
dis_bars, // Display bars
dis_line, // Display lines
dis_arro, // Display arrows
dis_barl, // Display bars and lines
dis_bara, // Display bars and arrows
dis_lina, // Display lines and arrows
dis_all // Display bars, lines and arrows
};
The parameters to be called are ....

extern ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT; // Time frame to use
extern int SlowLength = 7; // Slow length
extern double SlowPipDisplace = 0; // Slow pips displacement
extern int FastLength = 3; // Fast length
extern double FastPipDisplace = 0; // Fast pips displacement
//extern bool AlertsOn = false; // Turn alerts on?
//extern bool AlertsOnCurrent = true; // Alerts on current (still opened) bar?
//extern bool AlertsMessage = true; // Alerts should display pop-up message?
//extern bool AlertsSound = false; // Alerts should play a sound?
//extern bool AlertsEmail = false; // Alerts should send email?
//extern enDisplay DisplayWhat = dis_line; // Display type
extern bool Interpolate = true; // Interpolate in multi time frame mode?

and the iCustom should be like this .... ????????????

iCustom(NULL,0,"ptl 2_2",TimeFrame,SlowPipDisplace,FastLength,FastPipDisplace,false,false,false,false,false,dis_line,Interpolate,0,i);

Sorry, but we have no programming knowledge, and we try to give some solutions ....
Waiting for your help ....
Best Regards
Dimitri

Re: Coding Help

239
Dimitri wrote: Sat May 06, 2017 11:48 pm Dear Mladen,
Thank you for your kind reply ....
Just to clarify if it is well understood ....

I have to copy & paste following part of the code ...

enum enDisplay
{
dis_bars, // Display bars
dis_line, // Display lines
dis_arro, // Display arrows
dis_barl, // Display bars and lines
dis_bara, // Display bars and arrows
dis_lina, // Display lines and arrows
dis_all // Display bars, lines and arrows
};
The parameters to be called are ....

extern ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT; // Time frame to use
extern int SlowLength = 7; // Slow length
extern double SlowPipDisplace = 0; // Slow pips displacement
extern int FastLength = 3; // Fast length
extern double FastPipDisplace = 0; // Fast pips displacement
//extern bool AlertsOn = false; // Turn alerts on?
//extern bool AlertsOnCurrent = true; // Alerts on current (still opened) bar?
//extern bool AlertsMessage = true; // Alerts should display pop-up message?
//extern bool AlertsSound = false; // Alerts should play a sound?
//extern bool AlertsEmail = false; // Alerts should send email?
//extern enDisplay DisplayWhat = dis_line; // Display type
extern bool Interpolate = true; // Interpolate in multi time frame mode?

and the iCustom should be like this .... ????????????

iCustom(NULL,0,"ptl 2_2",TimeFrame,SlowPipDisplace,FastLength,FastPipDisplace,false,false,false,false,false,dis_line,Interpolate,0,i);

Sorry, but we have no programming knowledge, and we try to give some solutions ....
Waiting for your help ....
Best Regards
Dimitri
Dimitri

Yes, you have to have that part of code in your code too (this part :

Code: Select all

enum enDisplay
{
   dis_bars,  // Display bars
   dis_line,  // Display lines
   dis_arro,  // Display arrows
   dis_barl,  // Display bars and lines
   dis_bara,  // Display bars and arrows
   dis_lina,  // Display lines and arrows
   dis_all    // Display bars, lines and arrows
};

Re: Coding Help

240
Dimitri wrote: Sat May 06, 2017 11:25 pm Dear wojtek, thank you for your kind reply. I have followed your instruction but the result is not achieving requested operation.
Waiting for additional help ... Thank you anyway ....
Best Regards
Dimitri
OK, it would work if you declare

Code: Select all

// extern 
             int DisplayWhat  = 1;
I remember I used it in the iCustom function for enumerative variables in ex4 indicators.


Who is online

Users browsing this forum: No registered users and 21 guests