ICustom function - page 14

 

Indicator

Most probably it can be done. You need to send the indicator to a coder and he do the Job. If you are intrested I can do it.

 

Trading from Indicator

Hi There,

I have an indicator that creates an alert and draws an arrow (up or down) when a trade signal is indicated. It is a bought indicator (yes I did actually pay for it myself...) so i don't have the code, just the complied file.

Is there any way to create an EA to trade when an indicator alerts, or draws on a chart??

The indicator doesn't appear to be using any indicator buffers, it is simply measuring a range of other indicators to make a trading decision. That means I can't read a level using iCustom.

Any help appreciated.

cheers

Edit: Ok.. not sure why my post got moved to the iCustom thread, when my post specifically says... "I can't read a level using iCustom", but maybe someone will help me anyway...

Perhaps my question should be rephrased as

is there any way to read the contents of the alerts window with an EA??

 

Problem referencing iCustom

Hi There

I have used several generic EA templates and tried referencing iCustom, but the EA doesn't trade even though it compiles ok and the indicator itself generates "trade signals".

I think I'm referencing iCustom incorrectly. Inputs are appreciated.

I'm trying to reference two values from the indicator Complex_Pairs1.

One is the signalline (SetIndexBuffer 0), the other one is the moving average of the signalline (SetIndexBuffer 1).

The indicator has two external parameters:

SignalType (for type of signal in case of an indicator crossover)

periodSMA (the period of the simple moving average)

I have pasted the relevant part of the sourcecode below.

Using iCustom I try to access 4 different values - the signalline and the SMA at bar 1 and bar 2, and I'm using this code:

double SignallineShift1 = iCustom(NULL,NULL,"Complex_Pairs1", 2,0,0,1);

double SmaShift1 = iCustom(NULL,NULL,"Complex_Pairs1", 2,4,1,1);

double SignallineShift2 = iCustom(NULL,NULL,"Complex_Pairs1", 2,0,0,2);

double SmaShift2 = iCustom(NULL,NULL,"Complex_Pairs1", 2,4,1,2);

Am I referencing the indicator values correctly? iCustom(symbol, timeframe, indicator name, SignalType, periodSMA, IndexBuffer, Shift). Or should I maybe omit signaltype and periodsma for the signal line, and signalType for the SMA?

Cheers

Tomas

___________________________________ ________________

#property indicator_separate_window

#property indicator_buffers 2

#property indicator_color1 Green

#property indicator_color2 Red

#property indicator_width2 1

//---- buffers

double pair[],ma[];

//----

extern int SignalType=2;

extern int periodSMA=4;

SetIndexStyle(0, DRAW_LINE);

SetIndexStyle(1, DRAW_LINE);

SetIndexBuffer(0, pair);

SetIndexBuffer(1, ma);

 

Have tried using zero

By the way.

I have tried using zero instead of NULL for the timeframe value. The EA still doesn't work.

 

Your MA values need to be set > 0

TTrade:
By the way. I have tried using zero instead of NULL for the timeframe value. The EA still doesn't work.

Hi Tomas,

double SignallineShift1 = iCustom(NULL,NULL,"Complex_Pairs1", 2,0,0,1);

double SmaShift1 = iCustom(NULL,NULL,"Complex_Pairs1", 2,4,1,1);

double SignallineShift2 = iCustom(NULL,NULL,"Complex_Pairs1", 2,0,0,2);

double SmaShift2 = iCustom(NULL,NULL,"Complex_Pairs1", 2,4,1,2);

1) Use 0 for TF instead of NULL

2) Your SignallineShift1 and SignallineShift2 has no "periodma".

a) The MA period has to be at least 1 (the same as the current price line - it cannot be 0)

b) In your example ALL "periodma" needs to be set at 4.

3) Print the values in the logs or as Comments on the charts to make sure you can see the EA is getting the indicator values

Example:

Print(" SignallineShift1 = ",SignallineShift1);

Comment(" SignallineShift1 = ",SignallineShift1);

Hope this helps,

Robert

 

forex-tsd ' manager

thanks for your help

 
 

a question

I had an indicator that have 7 buffer

as the color for trend is at 7th buffer.

how am I able to get the 7th buffer.

attach is the indicator that I use

Files:
 

yew, when I woke up this morning

AUSSIE dollar surge sharley (relative to my cross pairs) i.e. aussie dollar weaken across the board

therefore, despite the downtrend (last leg) on friday evening, I have to CHASE the direction

then later on today, after aussie QUANTAS relief, aussie dollar back to the strengthen direction

not sure which direction I should bet right now , or should I follow the MA trend

it is on DEMO account, but I got feeling and empathy as much as it is my real account

-----

anyway

don't have the answer that you want , but ..... . ..

most of the MQ4 count from 0 , 1 2 3 (zero first)

but the buffer-- just the name of an array

only do 1 2 3 4 5 6 -- not 7th

so you might explicit explain what you see -- or you might look at it wrongly

there are many MTF HA anyway -- I have not tried out yours yet, just read it in my Meta-Editor

 
xx3xxx:
yew, when I woke up this morning

AUSSIE dollar surge sharley (relative to my cross pairs) i.e. aussie dollar weaken across the board

therefore, despite the downtrend (last leg) on friday evening, I have to CHASE the direction

then later on today, after aussie QUANTAS relief, aussie dollar back to the strengthen direction

not sure which direction I should bet right now , or should I follow the MA trend

it is on DEMO account, but I got feeling and empathy as much as it is my real account

-----

anyway

don't have the answer that you want , but ..... . ..

most of the MQ4 count from 0 , 1 2 3 (zero first)

but the buffer-- just the name of an array

only do 1 2 3 4 5 6 -- not 7th

so you might explicit explain what you see -- or you might look at it wrongly

there are many MTF HA anyway -- I have not tried out yours yet, just read it in my Meta-Editor

I think the part I am confused about is how is it possible to get the data out... if there is example for the icustom that would help

Reason: