Need some advise

 

I do have a custom indicator that uses . Generating a buy or sell signal. My Question is how to pass the value of variable 'flag' either 1, 0, or -1 generated in my Custom Indicator to my EA? iCustom returns the currency value of the indicator, but I do need only that the generated flag status is passed from the Indicator to my EA, the ICustom value itself is of no interest. Is that possible, and if so, how? Or impossible?

Any advise welcome.

 
WebFox:

I do have a custom indicator that uses . Generating a buy or sell signal. My Question is how to pass the value of variable 'flag' either 1, 0, or -1 generated in my Custom Indicator to my EA? iCustom returns the currency value of the indicator, but I do need only that the generated flag status is passed from the Indicator to my EA, the ICustom value itself is of no interest. Is that possible, and if so, how? Or impossible?

Any advise welcome.

Probably you may use the iCustom() with the incorrect mode. Look at the buffer wich is used to return the value you are looking for and put its number in the mode parameter of iCustom.

If you don't manage with that, show the buffer declaration of your indicator for more help from me.

Good luck.

 
Jacques366:

Probably you may use the iCustom() with the incorrect mode. Look at the buffer wich is used to return the value you are looking for and put its number in the mode parameter of iCustom.

If you don't manage with that, show the buffer declaration of your indicator for more help from me.

Good luck.

I guess I have the right parameters as my Indicator works well and shows the same when uses in iCustom... The flag value and variable is not part of the parameters and calculated as result of several parameters and average movements. Its an internal variable of the Indicator, which I tried also as extern variable of the Indicator, but both do not show up in any buffer. Maybe you can advise on how to set a calculated variable into any buffer EA can read. Maybe there is my understanding blocked...

 
WebFox:

I guess I have the right parameters as my Indicator works well and shows the same when uses in iCustom... The flag value and variable is not part of the parameters and calculated as result of several parameters and average movements. Its an internal variable of the Indicator, which I tried also as extern variable of the Indicator, but both do not show up in any buffer. Maybe you can advise on how to set a calculated variable into any buffer EA can read. Maybe there is my understanding blocked...

Why don't you add another buffer and use it to communicate the data you need?

 
Jacques366:

Why don't you add another buffer and use it to communicate the data you need?

Jacques, there is maybe my deadlook ;) Can you pls give me a short example how to add such buffer for variable flag (int) in my indicator and my EA so EA can use the Buffer value? I am real lost here any help or advise warmly welcomed. Was reading a lot about buffers now, only I did not manage to switch on light in the darkness of my brain, nor testings did show any result. Pls be so kind to show me a brief example how such lines are to formulate in my indicator and my EA for accepting by the EA. Thx a lot.

 
WebFox:

Jacques, there is maybe my deadlook ;) Can you pls give me a short example how to add such buffer for variable flag (int) in my indicator and my EA so EA can use the Buffer value? I am real lost here any help or advise warmly welcomed. Was reading a lot about buffers now, only I did not manage to switch on light in the darkness of my brain, nor testings did show any result. Pls be so kind to show me a brief example how such lines are to formulate in my indicator and my EA for accepting by the EA. Thx a lot.

Sorry, I have not a lot of time for you right now...

Try this: declare a buffer like any other buffer in your indicator (example: SetIndexBuffer(5,MyDataBuffer); 5 being the number of your new buffer (suppose there were 4 before so also don't forget to increase this number in your declaration), MyDataBuffer being declared as double MyDataBuffer[];) and then somwhere in the code (where you know the instruction will be executed) set this buffer to the value you want in your EA:

MyDataBuffer[0] = TheValueIWantInMyEA;

In your EA use the buffer 5 to retrieve this data.

If it's not working some tests must be done with your indicator code. I f you don't want to show it then may be someone else will continue to help you. I cannot spent more time guessing what's your problem.

 
Jacques366:

Sorry, I have not a lot of time for you right now...

Try this: declare a buffer like any other buffer in your indicator (example: SetIndexBuffer(5,MyDataBuffer); 5 being the number of your new buffer (suppose there were 4 before so also don't forget to increase this number in your declaration), MyDataBuffer being declared as double MyDataBuffer[];) and then somwhere in the code (where you know the instruction will be executed) set this buffer to the value you want in your EA:

MyDataBuffer[0] = TheValueIWantInMyEA;

In your EA use the buffer 5 to retrieve this data.

If it's not working some tests must be done with your indicator code. I f you don't want to show it then may be someone else will continue to help you. I cannot spent more time guessing what's your problem.

Many thx, that was it, sometimes I have simply a block for understanding (I am 64 by now and start to use my knowledge (longstanding one) as MT programming newcomer for myself ), the simple explanation from you was extreme fine and understood, and now it works! Great, and thx for your time again.

Reason: