Coding help - page 305

 
Boomerang:
Hi

Please can anybody help coding an indicator with the following Criteria:

User Input:

1- Time frame: current time frame from 1minute to 4 hours:

2- RSI(period): default setting 14

3- RSI levels:

a- Up level: from 50 to 100

b- Down level: from 0 to 50

c- Medium level: 50

4- Signal mode:

a- Sell mode: show only sell signals.

b- Buy mode: show only buy signals.

5- X= user defined few pips above or below current day high or low.

Signals in sell mode:

1- Sell mode day: show only sell signal on chart.

2- Wait for RSI to cross up level from below then to retrace below medium level from above.

3- Draw a red down arrow at the close of 1st candle crossing medium level from above.

4- Draw a green dot above the day high by x pips before red arrow signal.

5- Alert and email possibility (true, false).

6- Disregard any crossing (up, down and medium) before A and after B time:

a- Default A: 8:15 of the platform.

b- Default B: 22:00 of the platform.

Signals in buy mode:

1- Buy mode day: show only buy signal on chart.

2- Wait for RSI to cross down level from above then to retrace above medium level from below.

3- Draw a green up arrow at the close of 1st candle crossing medium level from below.

4- Draw a red dot below the day low by X pips before green arrow signal.

5- Alert and email possibility (true, false).

6- Disregard any crossing (up, down and medium) before A and after B time:

a- Default A: 8:15 of the platform.

b- Default B: 21:00 of the platform.

Example:

Thanks in advance

Boomerang

Why did you not take the first signal too (same condition as the signal you marked)?

 

heiken_ashih_sw_mtf_chrt.mq4

hello, Mr.Tools kindly made this for me a while back, but now it will not compile in new MT4, errors being with timeframetoString code, saying "char" not valid etc!

Please can you fix?

it does still work visually, but i have a second version for "separate window" that did not survive transition properly, left only the .ex4 file that works but I think the alerts stopped working, so I am trying to recompile it again to check. I need the same one for main window and separate window. Thanks.

 
zigflip:
heiken_ashih_sw_mtf_chrt.mq4

hello, Mr.Tools kindly made this for me a while back, but now it will not compile in new MT4, errors being with timeframetoString code, saying "char" not valid etc!

Please can you fix?

it does still work visually, but i have a second version for "separate window" that did not survive transition properly, left only the .ex4 file that works but I think the alerts stopped working, so I am trying to recompile it again to check. I need the same one for main window and separate window. Thanks.

Zigflip this is the chart version made compatible, any chance you have the separate window version, so can make it compatible as well.

 

Pls can somebody help me with this code...it always repeat the same alert.e.g if it bring buy alert on a pair, after about 7 candle, it will bring the same buy alert on the same pair.I want it to work that when it bring BUY alert on a pair,it will not bring BUY signal again on that pair until after it has delivered SELL signal:

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Lime

#property indicator_color2 Red

//--- buffers

double ExtMapBuffer1[];

double ExtMapBuffer2[];

//external variable......

extern int barsToProcess=100;

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0,217);

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexEmptyValue(0,0.0);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1,217);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexEmptyValue(1,0.0);

//----

return(0);

}

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

//| Custom indicator deinitialization function |

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

int deinit()

{

//----

//----

return(0);

}

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

//| Custom indicator iteration function |

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

int start()

{

int counted_bars=IndicatorCounted(),

limit;

if(counted_bars>0)

counted_bars--;

limit=Bars-counted_bars;

if(limit>barsToProcess)

limit=barsToProcess;

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

{

double ema13=iMA(NULL,0,13,0,MODE_EMA,PRICE_CLOSE,0);

double ema5=iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE,0);

double b4ema13=iMA(NULL,0,13,0,MODE_EMA,PRICE_CLOSE,1);

double b4ema5=iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE,1);

double mom=iMomentum(NULL,0,14,PRICE_CLOSE,0);

double b4mom=iMomentum(NULL,0,14,PRICE_CLOSE,1);

}

static datetime lastAlerted=0;

static string AlertType1="";

static string AlertType2="";

//up alerts

if((ema5>ema13)&&(ema5>b4ema5)&&(ema13>b4ema13)&&(mom>b4mom)&&(mom>98.6591)&&(lastAlerted!=Time[0])&&(AlertType1!="Buy")){

ExtMapBuffer1=High+5*Point;

}else

ExtMapBuffer1=0.0;

Alert(Symbol()," ",Period(),"M Price UP");

//sell alerts

if((ema5<ema13)&&(ema5<b4ema5)&&(ema13<b4ema13)&&(mom<b4mom)&&(mom<100.6872)&&(lastAlerted!=Time[0])&&(AlertType2!="Sell")){

ExtMapBuffer2=Low-5*Point;

}else

ExtMapBuffer2=0.0;

Alert(Symbol()," ",Period(),"M Price Down");

return(0);

}

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

 
mrtools:
Zigflip this is the chart version made compatible, any chance you have the separate window version, so can make it compatible as well.

Thanks!

I just have the .ex4 file for the separate window version and I don't know how that happened but cannot find the .mq4 anywhere!

I just changed the chart version before to make the separate version, by just changing the one line at the top - indicator property - from chart_window to separate window - isn't that ok?

 

Hi Guys,

I need your help. How do I send you a copy of an indicator I need you to modify for me? I just don't know how to do it. Thanks for your time.

Steve,

 
Genesisman:
Hi Guys,

I need your help. How do I send you a copy of an indicator I need you to modify for me? I just don't know how to do it. Thanks for your time.

Steve,

If that is a public code, simply post it here (press the "go advanced" and there you will find how to attach a file)

 
Mastercash:
Pls can somebody help me with this code...it always repeat the same alert.e.g if it bring buy alert on a pair, after about 7 candle, it will bring the same buy alert on the same pair.I want it to work that when it bring BUY alert on a pair,it will not bring BUY signal again on that pair until after it has delivered SELL signal:

#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 Lime

#property indicator_color2 Red

//--- buffers

double ExtMapBuffer1[];

double ExtMapBuffer2[];

//external variable......

extern int barsToProcess=100;

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0,217);

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexEmptyValue(0,0.0);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1,217);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexEmptyValue(1,0.0);

//----

return(0);

}

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

//| Custom indicator deinitialization function |

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

int deinit()

{

//----

//----

return(0);

}

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

//| Custom indicator iteration function |

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

int start()

{

int counted_bars=IndicatorCounted(),

limit;

if(counted_bars>0)

counted_bars--;

limit=Bars-counted_bars;

if(limit>barsToProcess)

limit=barsToProcess;

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

{

double ema13=iMA(NULL,0,13,0,MODE_EMA,PRICE_CLOSE,0);

double ema5=iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE,0);

double b4ema13=iMA(NULL,0,13,0,MODE_EMA,PRICE_CLOSE,1);

double b4ema5=iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE,1);

double mom=iMomentum(NULL,0,14,PRICE_CLOSE,0);

double b4mom=iMomentum(NULL,0,14,PRICE_CLOSE,1);

}

static datetime lastAlerted=0;

static string AlertType1="";

static string AlertType2="";

//up alerts

if((ema5>ema13)&&(ema5>b4ema5)&&(ema13>b4ema13)&&(mom>b4mom)&&(mom>98.6591)&&(lastAlerted!=Time[0])&&(AlertType1!="Buy")){

ExtMapBuffer1=High+5*Point;

}else

ExtMapBuffer1=0.0;

Alert(Symbol()," ",Period(),"M Price UP");

//sell alerts

if((ema5<ema13)&&(ema5<b4ema5)&&(ema13<b4ema13)&&(mom<b4mom)&&(mom<100.6872)&&(lastAlerted!=Time[0])&&(AlertType2!="Sell")){

ExtMapBuffer2=Low-5*Point;

}else

ExtMapBuffer2=0.0;

Alert(Symbol()," ",Period(),"M Price Down");

return(0);

}

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

This would be a way to do it.

Files:
m.mq4  4 kb
 

Dear Mrtools

In attached indicator 'macd signal line' calculations is in SMA, can it be calculated in EMA (like Gerald Appel MACD) ?

In some time frame MACD does not show properly, is it possible to add multiplier in it for better visual !

Thanks for any help

secretcode

Files:
macdcci.mq4  4 kb
 
secretcode:
Dear Mrtools

In attached indicator 'macd signal line' calculations is in SMA, can it be calculated in EMA (like Gerald Appel MACD) ?

In some time frame MACD does not show properly, is it possible to add multiplier in it for better visual !

Thanks for any help

secretcode

Hi Secretcode, added mode options for fast, slow, and signal ma's for the macd, and added the multiplier.

Files: