Indicators with alerts/signal - page 321

 

Help Wiht Alert

Can someone help me with this indy? I would like to have this alert only once. Right now is alerts on every bar that the conditions are correct.

 
mrtools:
Don't have that worry in E_ _ _ _ word section , probably only non repainting jurik systems available in MT4!

what's the pink/blue indicator in the main window? Can you post it, please?

 

Need Help In Adding Sound Alert To Indicator!!

Hi Guys, I've an indicator which can predict the future trend. However, I need someone who can add alert which triggers whenever the indicator changes its colour (bullish or bearish). Those who can suggest any indicator which goes along with this indicator may do so. Hurry!! :-D Thank you.

 

90% Accurate Indicator!!!

Guys!! Any of you could develop this indicator into an EA? I find it very useful. It works on all currencies and all timeframes. You guys can develop it into an EA by including auto-trade when the indicator changes its colour (upon confirmation), include sound alerts, stop loss, take profit, amount of lots to trade, etc. Your suggestions/recommendations are most welcome. You can view the pictures I've attached.

Files:
 

hi

i can't download and see any code

and most of accurate indicators is giving signal too late

 

Attn:Ijargal(ref #95)

I've no problem using/downloading the indicator. However, I will post for you the code for it. You said that most of the accurate indicators are giving signal too late. Why not we try it first and see for ourselves?

 

iCustom Statements For TrendPredictor

mashriq:
I've no problem using/downloading the indicator. However, I will post for you the code for it. You said that most of the accurate indicators are giving signal too late. Why not we try it first and see for ourselves?

Hi Mashriq,

I'm curious to see how the TrendPredictor indicator works for you, so here are the iCustom statements to use this indicator in an EA.

The following are the Buffers for the TrendPredictor Indicator...

//---- TrendPredictor Indicator ----//

IndicatorBuffers(4);

SetIndexBuffer(0,Uptrend);

SetIndexBuffer(1,Dntrend);

SetIndexBuffer(2,SAR);

SetIndexBuffer(3,MA);

The indicator has no User "externs" to include in the iCustom statements so that makes it easier.

Here are the iCustom statements you can use to get the Buffer values...

double UpTrend_0 = iCustom(NULL,0,"TrendPredictor",0,0);

double DnTrend_1 = iCustom(NULL,0,"TrendPredictor",1,0);

double SAR_2 = iCustom(NULL,0,"TrendPredictor",2,0);

double MA_3 = iCustom(NULL,0,"TrendPredictor",3,0);

Put the iCustom statements in any basic EA template and then add your Buy/Sell conditions.

Please share your progress and results with your EA and this indicator.

Hope this helps,

Robert

 

Attn:Cosmiclifeform (Robert)

Thank you,Robert. If you don't mind, can you teach me how and where to insert the icustom statements? I am new to all this coding.

 

Attn:Ijargal(ref #96)

#property indicator_separate_window

#property indicator_buffers 2

#property indicator_color1 Lime

#property indicator_color2 Red

#property indicator_width1 3

#property indicator_width2 3

// Buffers

double SAR[];

double MA[];

double Uptrend[];

double Dntrend[];

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

//---- indicators

IndicatorBuffers(4);

SetIndexBuffer(0,Uptrend);

SetIndexBuffer(1,Dntrend);

SetIndexBuffer(2,SAR);

SetIndexBuffer(3,MA);

SetIndexStyle(0,DRAW_LINE);

SetIndexStyle(1,DRAW_LINE);

SetIndexStyle(2,DRAW_NONE);

SetIndexStyle(3,DRAW_NONE);

SetIndexLabel(0,"Uptrend");

SetIndexLabel(1,"Downtrend");

SetIndexEmptyValue(0,EMPTY_VALUE);

SetIndexEmptyValue(1,EMPTY_VALUE);

IndicatorShortName("AutoTrendForecast");

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator deinitialization function |

//+------------------------------------------------------------------+

int deinit()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{

int limit, counted_bars=IndicatorCounted();

//----

limit = Bars - counted_bars - 1;

for(int i=0;i<limit;i++)

{

SAR = iSAR(Symbol(),0,0.01,0.1,i);

MA = iMA(Symbol(),0,14,0,MODE_SMA,PRICE_CLOSE,i);

}

for(i=0;i<limit;i++)

{

if(SAR < Close)

{

Uptrend = MA;

Dntrend = EMPTY_VALUE;

}

if(SAR Close) Dntrend = MA;

if(SAR > Close)

{

Dntrend = MA;

Uptrend = EMPTY_VALUE;

}

if(SAR > Close && SAR < Close) Uptrend = MA;

}

//----

return(0);

}

//+------------------------------------------------------------------+

 

Use EA Builder Templates To Learn Coding

mashriq:
Thank you,Robert. If you don't mind, can you teach me how and where to insert the icustom statements? I am new to all this coding.

Hi Mashrig,

There are a number of EA builder templates on the internet and Forex forums to let you learn how to build your own EA's.

Here is one website for a basic EA Builder called Expert Advisor Builder for MT4.

This for me is the most simple EA Template to start learning with.

Expert Advisor Builder for MetaTrader 4

It only uses the basic built-in indicators to start with, so you can't add your iCustom statements into the online template.

But....after you see the basic structure of this EA template...you can search and find many EA's already using this EA Builder template...and you can use them to compare the iCustom statements and learn from the code.

When you are ready, save and rename the EA samples you want to play with, and replace the iCustom statements and related variables and Buy/Sell conditions with your own.

The key to identifying this particular Expert Advisor Builder is the lines at the top that define the signals:

#define SIGNAL_NONE 0

#define SIGNAL_BUY 1

#define SIGNAL_SELL 2

#define SIGNAL_CLOSEBUY 3

#define SIGNAL_CLOSESELL 4

* Note - WHRoeder has nicely pointed out a number of coding inefficiencies for this EA template, but it's a great basic EA template to use and learn from. And because it's pretty modular, it's very easy to add and change the iCustom statements and Buy/Sell conditions, then recompile and test in the Strategy Tester.

You will be starting on a very exciting, sometimes frustrating, but always rewarding adventure in coding EA's... Careful...coding can be addicting...!

Good luck and God's Speed.

Hope this helps,

Robert

Reason: