Coding help - page 450

 

Hi King mladen sir,

In this file, i need one modification, current candle high/ low engulf previous candle open close bodies., one step ongoing bar you already added it, which shows that you already knows,you're genius, everybody knows.

regards

Files:
audusdh15.png  28 kb
 
keansajeweki:
Hello Mladen. Can you please look at this threat, because when i insert it to my MT4 and start up again, i don't have an ex file. its the USC Murrey Math Oscillator V2

Please attach the exact file you are using so someone can take a look at it

 
hanic:
Hi King mladen sir,

In this file, i need one modification, current candle high/ low engulf previous candle open close bodies., one step ongoing bar you already added it, which shows that you already knows,you're genius, everybody knows.

regards

That candles high did not engulf previous 3 bars highs (take a closer look at the high of that bar and compare it to the high 2 bars back)

Also you can not compare apples and pears : if open/close (the body) is compared, then high and low of the current bar are not used but open/close (body) too. If you use high./low then the compared bars highs/lows are used too

 

Pivot Point Confluence text

I found a nice MT4 Pivot Point Confluence Indicator but it doesn't show text labels and numbers like on the image below. It only draws lines but I also like to see text and numbers on.

Files:
 
keansajeweki:
Hello Mladen. Can you please look at this threat, because when i insert it to my MT4 and start up again, i don't have an ex file. its the USC Murrey Math Oscillator V2

keansajeweki

That is tradingView code (not metatrader code)

Someone posted it as mq4 but it has nothing to do with metatrader

 

could any kind person please fix this to work on a 6 digit broker?

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

//| 70/50VolBreakout.mq4 |

//| Keris2112 |

//| |

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

#property copyright "Keris2112"

#property link ""

#property indicator_chart_window

#property indicator_buffers 4

#property indicator_color1 DodgerBlue

#property indicator_color2 Red

#property indicator_color3 Sienna

#property indicator_color4 Lime

#property indicator_width1 5

#property indicator_width2 3

#property indicator_width3 5

#property indicator_width4 3

extern int EntryPercent = 70;

extern int StopPercent = 50;

int i=1, shift;

double PrevRange;

double LongEntry;

double LongStop;

double ShortEntry;

double ShortStop;

bool result;

//---- buffers

double ExtMapBuffer1[];

double ExtMapBuffer2[];

double ExtMapBuffer3[];

double ExtMapBuffer4[];

double ExtMapBuffer5[];

bool isNewDay(int _shift)

{

//----

result=false;

if ( (TimeHour(Time[_shift])==0) && (TimeMinute(Time[_shift])==0) ) result=true;

//----

return(result);

}

void GetRS1ofDay(int _shift)

{

int prevDay=TimeDay(Time[_shift+1]);

//----

i=1;

while (TimeDay(Time[_shift+i])==prevDay) i++;

i--;

PrevRange=High - Low[Lowest(NULL,0,MODE_LOW,i,_shift+1)];

LongEntry = Open[_shift] + (PrevRange * (EntryPercent*0.01));

LongStop = LongEntry - (PrevRange * (StopPercent*0.01));

ShortEntry = Open[_shift] - (PrevRange * (EntryPercent*0.01));

ShortStop = ShortEntry + (PrevRange * (StopPercent*0.01));

ExtMapBuffer1[_shift] = LongEntry;

ExtMapBuffer2[_shift] = LongStop;

ExtMapBuffer3[_shift] = ShortEntry;

ExtMapBuffer4[_shift] = ShortStop;

Comment(

"Previous Range: ",PrevRange*1/Point," pips",

"\n",(EntryPercent),"% of Previous Range: ",MathRound((EntryPercent*PrevRange*(0.01/Point)))," pips",

"\n",(StopPercent),"% of Previous Range: ",MathRound((StopPercent*PrevRange*(0.01/Point)))," pips",

"\nOpen: ",Open[_shift],

"\nEnter BuyStop at: ",ExtMapBuffer1[_shift]," with StopLoss at: ",ExtMapBuffer2[_shift],

"\nEnter SellStop at: ",ExtMapBuffer3[_shift]," with StopLoss at: ",ExtMapBuffer4[_shift]);

}

void CopyLevels1Day(int _shift)

{

ExtMapBuffer1[_shift]=ExtMapBuffer1[_shift+1];

ExtMapBuffer2[_shift]=ExtMapBuffer2[_shift+1];

ExtMapBuffer3[_shift]=ExtMapBuffer3[_shift+1];

ExtMapBuffer4[_shift]=ExtMapBuffer4[_shift+1];

ExtMapBuffer5[_shift]=ExtMapBuffer5[_shift];

}

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicators

IndicatorBuffers(4);

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0,160);

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexEmptyValue(0,0.0);

SetIndexLabel(0,0);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1,160);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexEmptyValue(1,0.0);

SetIndexLabel(1,0);

SetIndexStyle(2,DRAW_ARROW);

SetIndexArrow(2,160);

SetIndexBuffer(2,ExtMapBuffer3);

SetIndexEmptyValue(2,0.0);

SetIndexLabel(2,0);

SetIndexStyle(3,DRAW_ARROW);

SetIndexArrow(3,160);

SetIndexBuffer(3,ExtMapBuffer4);

SetIndexEmptyValue(3,0.0);

SetIndexLabel(3,0);

SetIndexBuffer(0,ExtMapBuffer5);

//----

return(0);

}

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

//| Custor indicator deinitialization function |

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

int deinit()

{

//----

//----

return(0);

}

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

//| Custom indicator iteration function |

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

int start()

{

int limit,firstDay;

int counted_bars=IndicatorCounted();

if (counted_bars<0) return(0);

if (counted_bars==0)

{

limit=Bars-1;

i=1;

firstDay=TimeDay(Time[limit]);

while (TimeDay(Time[limit-i])==firstDay) i++;

limit=limit-i-PERIOD_D1/Period();

}

if (counted_bars>0) limit=Bars-counted_bars;

//----

if (Period()>PERIOD_D1) return;

for (shift=limit;shift>=0;shift--)

{

if (isNewDay(shift)) GetRS1ofDay(shift); else CopyLevels1Day(shift);

}

//----

return(0);

}

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

 

Hello Mladen - as always thanks for your response - is it within your skill set to possibly build such an indicator? thanks in advance again.

mladen:
As far as I searched, there is no such indicator
 
angrysky:
could any kind person please fix this to work on a 6 digit broker?

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

//| 70/50VolBreakout.mq4 |

//| Keris2112 |

//| |

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

#property copyright "Keris2112"

#property link ""

#property indicator_chart_window

#property indicator_buffers 4

#property indicator_color1 DodgerBlue

#property indicator_color2 Red

#property indicator_color3 Sienna

#property indicator_color4 Lime

#property indicator_width1 5

#property indicator_width2 3

#property indicator_width3 5

#property indicator_width4 3

extern int EntryPercent = 70;

extern int StopPercent = 50;

int i=1, shift;

double PrevRange;

double LongEntry;

double LongStop;

double ShortEntry;

double ShortStop;

bool result;

//---- buffers

double ExtMapBuffer1[];

double ExtMapBuffer2[];

double ExtMapBuffer3[];

double ExtMapBuffer4[];

double ExtMapBuffer5[];

bool isNewDay(int _shift)

{

//----

result=false;

if ( (TimeHour(Time[_shift])==0) && (TimeMinute(Time[_shift])==0) ) result=true;

//----

return(result);

}

void GetRS1ofDay(int _shift)

{

int prevDay=TimeDay(Time[_shift+1]);

//----

i=1;

while (TimeDay(Time[_shift+i])==prevDay) i++;

i--;

PrevRange=High - Low[Lowest(NULL,0,MODE_LOW,i,_shift+1)];

LongEntry = Open[_shift] + (PrevRange * (EntryPercent*0.01));

LongStop = LongEntry - (PrevRange * (StopPercent*0.01));

ShortEntry = Open[_shift] - (PrevRange * (EntryPercent*0.01));

ShortStop = ShortEntry + (PrevRange * (StopPercent*0.01));

ExtMapBuffer1[_shift] = LongEntry;

ExtMapBuffer2[_shift] = LongStop;

ExtMapBuffer3[_shift] = ShortEntry;

ExtMapBuffer4[_shift] = ShortStop;

Comment(

"Previous Range: ",PrevRange*1/Point," pips",

"\n",(EntryPercent),"% of Previous Range: ",MathRound((EntryPercent*PrevRange*(0.01/Point)))," pips",

"\n",(StopPercent),"% of Previous Range: ",MathRound((StopPercent*PrevRange*(0.01/Point)))," pips",

"\nOpen: ",Open[_shift],

"\nEnter BuyStop at: ",ExtMapBuffer1[_shift]," with StopLoss at: ",ExtMapBuffer2[_shift],

"\nEnter SellStop at: ",ExtMapBuffer3[_shift]," with StopLoss at: ",ExtMapBuffer4[_shift]);

}

void CopyLevels1Day(int _shift)

{

ExtMapBuffer1[_shift]=ExtMapBuffer1[_shift+1];

ExtMapBuffer2[_shift]=ExtMapBuffer2[_shift+1];

ExtMapBuffer3[_shift]=ExtMapBuffer3[_shift+1];

ExtMapBuffer4[_shift]=ExtMapBuffer4[_shift+1];

ExtMapBuffer5[_shift]=ExtMapBuffer5[_shift];

}

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicators

IndicatorBuffers(4);

SetIndexStyle(0,DRAW_ARROW);

SetIndexArrow(0,160);

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexEmptyValue(0,0.0);

SetIndexLabel(0,0);

SetIndexStyle(1,DRAW_ARROW);

SetIndexArrow(1,160);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexEmptyValue(1,0.0);

SetIndexLabel(1,0);

SetIndexStyle(2,DRAW_ARROW);

SetIndexArrow(2,160);

SetIndexBuffer(2,ExtMapBuffer3);

SetIndexEmptyValue(2,0.0);

SetIndexLabel(2,0);

SetIndexStyle(3,DRAW_ARROW);

SetIndexArrow(3,160);

SetIndexBuffer(3,ExtMapBuffer4);

SetIndexEmptyValue(3,0.0);

SetIndexLabel(3,0);

SetIndexBuffer(0,ExtMapBuffer5);

//----

return(0);

}

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

//| Custor indicator deinitialization function |

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

int deinit()

{

//----

//----

return(0);

}

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

//| Custom indicator iteration function |

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

int start()

{

int limit,firstDay;

int counted_bars=IndicatorCounted();

if (counted_bars<0) return(0);

if (counted_bars==0)

{

limit=Bars-1;

i=1;

firstDay=TimeDay(Time[limit]);

while (TimeDay(Time[limit-i])==firstDay) i++;

limit=limit-i-PERIOD_D1/Period();

}

if (counted_bars>0) limit=Bars-counted_bars;

//----

if (Period()>PERIOD_D1) return;

for (shift=limit;shift>=0;shift--)

{

if (isNewDay(shift)) GetRS1ofDay(shift); else CopyLevels1Day(shift);

}

//----

return(0);

}

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

It seems to be working

What is the problem you are experiencing?

Files:
test.gif  71 kb
 

Hi sir,

when we compare equation i.e. previous candle low or high, greater or smaller then previous candle, metatrader doesn't allow to do it?

In belthold pattern this formula is used, in this c >h1.

is it true that, we can't compare high low with open close bodies? i guess in many instances, in many candlestick pattern formula's high low is compared with candle bodies.

regards

Files:
mdsir.png  16 kb
belthold.png  20 kb
 
triip:
I found a nice MT4 Pivot Point Confluence Indicator but it doesn't show text labels and numbers like on the image below. It only draws lines but I also like to see text and numbers on.

I do not know which version was used to display like that, but it does not display like that in the old version of metatrader either (I tried it in build 432 too, and it displays exactly the same as in the new builds)

Reason: