Possible to Get Trade Signals from Compiled Indicator and Utilize it in an EA & Add Sound Alerts ?

FourX
1320
FourX  

Is it possible to Utilize Trade Signals from a Compiled Indicator to Utilize in an EA and perhaps Add Some Audible Alerts as well?

Thanks to one and all for any assistance with this (< 8)

bernd
989
bernd  
FourX:

Is it possible to Utilize Trade Signals from a Compiled Indicator to Utilize in an EA and perhaps Add Some Audible Alerts as well?

Thanks to one and all for any assistance with this (< 8)

Sure. Use the iCustom() function in your EA to read the indicator values or the arrows it creates
[Deleted]  
7bit:
Sure. Use the iCustom() function in your EA to read the indicator values or the arrows it creates

To use iCustom() you need to know the mode (buffer index) that holds the value of interest.

Also, you should know the parameters that go into the indicator (name, ...).

double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift)
bernd
989
bernd  
engcomp:

To use iCustom() you need to know the mode (buffer index) that holds the value of interest.

Also, you should know the parameters that go into the indicator (name, ...).

double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift)


The buffers and their content can be found out with the help of the data window. Attach the Indicator, open the data window and then move the mouse around on the chart. the data window will list all buffers of the indicator and their value for the bar under the mouse.

The inputs are exactly the same and in the same order as they appear in the input box where the indicator parameters are set.

[Deleted]  
7bit:


The buffers and their content can be found out with the help of the data window. Attach the Indicator, open the data window and then move the mouse around on the chart. the data window will list all buffers of the indicator and their value for the bar under the mouse.

The inputs are exactly the same and in the same order as they appear in the input box where the indicator parameters are set.

That's a good suggestion but the data window does not show the index assigned by...

//---- indicator buffers mapping
   SetIndexBuffer(0,MacdBuffer);
   SetIndexBuffer(1,SignalBuffer);
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("MACD("+FastEMA+","+SlowEMA+","+SignalSMA+")");
   SetIndexLabel(0,"MACD");
   SetIndexLabel(1,"Signal");

So if you only have the compiled version of the indicator, you may not know whether 0 or 1 is assigned to "MACD" and "Signal".

Or is there a way of knowing the index, which is needed for "mode"? Maybe the order in which the data appears, starting with 0?

bernd
989
bernd  
engcomp:

That's a good suggestion but the data window does not show the index assigned by...

So if you only have the compiled version of the indicator, you may not know whether 0 or 1 is assigned to "MACD" and "Signal".

Or is there a way of knowing the index, which is needed for "mode"? Maybe the order in which the data appears, starting with 0?

I believe it will always show them in the order of their index number, starting with 0. I haven't tried this with many different indicators, only a few for which I also had source code, but It seemed always to be in the correct order.


At least you can see how many buffers it has and what values to expect in those buffers and then in the next step actually call them via iCustom(), print some of the values and compare them to what you see in the data window to make sure you are indeed using the correct buffer numbers.