ICustom question .. - page 3

 
12BPRO:
Dear Codes GURU,

I have got the following scenario....

1) Indicator A which has all the following attributes coded in the file

a) comments

b) drawings line for divergence

c) sound and alert - set to true

If I use iCustom to call indicator A and make some calculation to produce another indicator B, would all of the attributes in the indicators A be showing and triggering in indicator B... this is what is happening to my indicator B...

Is this the case were I have got to REVISIT my codes again SIR....

Your advice and expertise is always highly appreciated....

yours truly

AZRUL...

AZRUL,

If all the attributes are text created in indicator A, they will be printed when indicator A is used in iCustom. iCustom suppresses only the graphic output, e.g. lines or histograms, but does not suppress text displayed by objectcreate.

The best thing to do is to create an input bool, DisplayText, as the first input item and set it to false. Then use "if(DisplayText) ..." to surround all the text printing in indicator A to turn it on or off based on either using indicator A directly on the screen or when called through iCustom

Good Luck, Tzuman

 
Tzuman:
AZRUL,

If all the attributes are text created in indicator A, they will be printed when indicator A is used in iCustom. iCustom suppresses only the graphic output, e.g. lines or histograms, but does not suppress text displayed by objectcreate.

The best thing to do is to create an input bool, DisplayText, as the first input item and set it to false. Then use "if(DisplayText) ..." to surround all the text printing in indicator A to turn it on or off based on either using indicator A directly on the screen or when called through iCustom

Good Luck, Tzuman

Dear Tzuman,

Thanks a lot for the advice, In this case there is nothing wrong with my Indicator B with is CALLING and calculating indicator A using iCustom.....

I got to learn to familiaries myself with the iCustom parameters to do that... never used them....

Would this HELP....??? by setting it to false...ect

yours truly

AZRUL...

 

There is nothing wrong with your indicator B. I am saying that if indicator A prints text on the screen and you use it in an iCustom Call in indicator B, MQ will suppress the graphic output but you must make a "switch" for indicator A to tell it when to print the text and when not to print the text.

double iCustom(

string symbol, // symbol

int timeframe, // timeframe

string name, // path/name of the custom indicator compiled program

... // custom indicator input parameters (if necessary)

int mode, // line index

int shift // shift

);

This is the iCustom definition from the documentation. It is in the custom indicator input parameters that you will place a boolean "false" that is the switch to turn off the text printing.

For example, this is the first few lines of one of my indicators that can be directly placed on a chart or called from iCustom. Notice the two booleans, Display and DisplayText. I use them to turn on drawing a breakout box and also displaying a text message on the screen.

#property indicator_chart_window

#property strict

extern bool Display = false;

extern int boxbarperiods = 16;

extern int boxbarmode = MODE_EMA;

extern int boxbaroffset = 0;

extern bool DisplayText = true;

extern string symbol = "";

extern int MoveHorizontal = 0;

extern int MoveVertical = 10;

so the iCustom call would be somenthing like this

data=iCustom(symbol,0,indicatorA,false,16,1,0,true,"XAGUSD",0,20,0,bar);

to print text for XAGUSD on a chart for EURUSD at the position 0,20.

Notice that you only need to specify as many input parameters as you wish to use in the iCustom call to your indicatorA. For my indicator there are 20 more parameters that are not specified as I chose to let them assume their default values. If you want to change the 10th parameter, you must specify all nine preceeding parameters. If you want to use all the indicator default settings, you do not need to specify any optional parameters.

Make sure when specifying the optional parameters they match the indicators parameter definitions exactly or you will receive errors and a very slow running indicator. For my example, specifying "false" or 3.14 for the first boolean parameter would cause an error as the first example is a string and the second is a double.

Good Luck

 
Tzuman:
There is nothing wrong with your indicator B. I am saying that if indicator A prints text on the screen and you use it in an iCustom Call in indicator B, MQ will suppress the graphic output but you must make a "switch" for indicator A to tell it when to print the text and when not to print the text.

double iCustom(

string symbol, // symbol

int timeframe, // timeframe

string name, // path/name of the custom indicator compiled program

... // custom indicator input parameters (if necessary)

int mode, // line index

int shift // shift

);

This is the iCustom definition from the documentation. It is in the custom indicator input parameters that you will place a boolean "false" that is the switch to turn off the text printing.

For example, this is the first few lines of one of my indicators that can be directly placed on a chart or called from iCustom. Notice the two booleans, Display and DisplayText. I use them to turn on drawing a breakout box and also displaying a text message on the screen.

#property indicator_chart_window

#property strict

extern bool Display = false;

extern int boxbarperiods = 16;

extern int boxbarmode = MODE_EMA;

extern int boxbaroffset = 0;

extern bool DisplayText = true;

extern string symbol = "";

extern int MoveHorizontal = 0;

extern int MoveVertical = 10;

so the iCustom call would be somenthing like this

data=iCustom(symbol,0,indicatorA,false,16,1,0,true,"XAGUSD",0,20,0,bar);

to print text for XAGUSD on a chart for EURUSD at the position 0,20.

Notice that you only need to specify as many input parameters as you wish to use in the iCustom call to your indicatorA. For my indicator there are 20 more parameters that are not specified as I chose to let them assume their default values. If you want to change the 10th parameter, you must specify all nine preceeding parameters. If you want to use all the indicator default settings, you do not need to specify any optional parameters.

Make sure when specifying the optional parameters they match the indicators parameter definitions exactly or you will receive errors and a very slow running indicator. For my example, specifying "false" or 3.14 for the first boolean parameter would cause an error as the first example is a string and the second is a double.

Good Luck

Dear Tzuman,

Thank YOU for your time very-very much for this very clear explanation....

All the best

yours truly

AZRUL...

Reason: