SuperTrend - page 7

 

can this be turned into an EA?

 

Trend indicator , how to programm when I see the changes only in the color

Hi,

I want to use an trend indicator. But I see the change from buy to sell only in the color of the indikator.

When I use the iCustom function in my metatrader I get only the value of the indikator back.

How can I see in my mq4 programm with the iCustom Function when the color of the trend indikator is changing from green to red or from red to green?

 

Doesn't anybody knows an answer or can't you understand my question.

 
sunshineh:
Doesn't anybody knows an answer or can't you understand my question.

I can try to help if you post the indicator.

 

The name of the indicator is Supertrend.

It only changes the color and know I think of adding a few pips when the indicator changes the signal, so I can search after the jump of the pips.

Files:
 
sunshineh:
The name of the indicator is Supertrend. It only changes the color and know I think of adding a few pips when the indicator changes the signal, so I can search after the jump of the pips.

The code is something like this.

bool indBuy=false;

bool indSell=false;

double sigBuy = iCustom(NULL,0,"SuperTrend",10,3,0,0);

double sigSell = iCustom(NULL,0,"SuperTrend",10,3,1,0);

if (sigBuy != EMPTY_VALUE) indBuy=true;

if (sigSell != EMPTY_VALUE) indSell=true;

if (indBuy==true)

{

// place a buy order

}

if (indSell==true)

{

// place a sell order

}

Hope it helps.

fxd01

 

Lot's of thanks!! This was a really great help!! I haven't seen the fact with that EMPTY_VALUE

 
sunshineh:
Lot's of thanks!! This was a really great help!! I haven't seen the fact with that EMPTY_VALUE

You're welcome.

As you know the value in the current bar may change since the bar is till not closed and the price can move up or down. You may want to take the signal from the previous closed bar by changing the code to

double sigBuy = iCustom(NULL,0,"SuperTrend",10,3,0,1);

double sigSell = iCustom(NULL,0,"SuperTrend",10,3,1,1);

 

Can anyone help me please,

Putting Indicators in to MT4, I have no trouble putting the Indicators in when they are an EX4 file but when they are the yellow MetaQoutes Language File, can't get them to work, They nare in my Experts/Indicator file but can't get them on my indicators on my MT4 platform,

Can anyone please tell me what I am not doing,

Thanks.

 
Reason: