Coding help - page 393

 
mladen:
Jeeves Here you go : manualordermanager_v7_1_nmc.mq4

Many, Many thanks my friend. I don't know how......but if there is ever anything I can do for you.....Just sing out

 

Please make an EA with this accurate indicator

Sir, i have a very accurate indicator. Anyone can make a EA with this indicator which should open buy order very fast/instantly when green arrow appears, and very fast/instantly sell order when red arrow appears on chart and with lot size, take profit (5 pips) and stop loss (100 pips) adjustment and should work with both demo and live account of any 5 digit broker. I will be very much thankful to you if you make an EA from this indicator.

 

Hi Mladen,

I would like to thank you for your suggestions. I have coded the EA according to it, now it is working. I would like to ask just one last question for now. The EA is currently picking the trend change after the 3rd bar. What would be the best way to pick the trend change on the 2nd bar if possible?

Please see attached code and screenshot.

double trendc = iCustom(Symbol(),0,"Hull moving average 2 strict nmc", "", HMA_Period, HMA_Price, HMA_Speed,0,3,1);

double trendp = iCustom(Symbol(),0,"Hull moving average 2 strict nmc", "", HMA_Period, HMA_Price, HMA_Speed,0,3,2);

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

//| BUY |

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

if(trendc!=trendp)

{

if(trendc==1) // code for buy

OpenBuy();

return(0);

}

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

//| SELL |

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

if(trendc==-1) // code for sell

{

OpenSell();

return(0);

}

}

Thank you in advance!

Files:
hma-go.jpg  119 kb
 
tfi_markets:
Hi Mladen,

I would like to thank you for your suggestions. I have coded the EA according to it, now it is working. I would like to ask just one last question for now. The EA is currently picking the trend change after the 3rd bar. What would be the best way to pick the trend change on the 2nd bar if possible?

Please see attached code and screenshot.

double trendc = iCustom(Symbol(),0,"Hull moving average 2 strict nmc", "", HMA_Period, HMA_Price, HMA_Speed,0,3,1);

double trendp = iCustom(Symbol(),0,"Hull moving average 2 strict nmc", "", HMA_Period, HMA_Price, HMA_Speed,0,3,2);

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

//| BUY |

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

if(trendc!=trendp)

{

if(trendc==1) // code for buy

OpenBuy();

return(0);

}

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

//| SELL |

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

if(trendc==-1) // code for sell

{

OpenSell();

return(0);

}

}

Thank you in advance!

tfi_markets

It is doing so now. What you are seeing is that one color starts from the previous bar end which causes you to think that there is one extra bar, and that must be done that way in order to avoid repainting. It must be like that in any multi color line indicator (regardless of the trading platform - it is the same using tradestation, ninjatraded, eSignal - whenever multi color line is concerned)

You can change the 1 and 2 in the iCustom() calls to 0 and 1 but in that case you would work with current (still opened) bar, and in that case you are risking a lot of false signals

 

hi Coders how are you?

What would be the code, for closing a buy order when an order sell opens? and the same for closing all sell orders when a buy order opens?

thanks

 

Please add Daily Open to current indicator

Mladen,

Is it possible to add a Daily Open line to the attached indicator and have it displayed to the right side of the chart in the

same manner as it currently displays Range High/Low information? This would allow me to eliminate a completely seperate indicator. As always your skills are sincerely appreciated.

 

Anyone like a challenge?!

Hi to all, especially those lovely , & helpful coders.

I have struggled most of the week to adapt the attached indicator from a "3 Ducks" to a "5 Ducks" indicator. I can only use the basic copy/cut & paste method of coding, and always end up looking at a blank screen! If there is a bored, possibly hungover, coder out there with nothing too important to do........put me out of my misery, help get me ready for trading on Monday!

I need a 5min & a 1D time frame added to the indie.

Files:
 
Jeeves:
Hi to all, especially those lovely , & helpful coders.

I have struggled most of the week to adapt the attached indicator from a "3 Ducks" to a "5 Ducks" indicator. I can only use the basic copy/cut & paste method of coding, and always end up looking at a blank screen! If there is a bored, possibly hungover, coder out there with nothing too important to do........put me out of my misery, help get me ready for trading on Monday!

I need a 5min & a 1D time frame added to the indie.

Jeeves

Try it out : 5_ducks_e_v01.mq4

Files:
 
mladen:
Jeeves Try it out : 5_ducks_e_v01.mq4

Good God.....That was quick. I'll put it on for Sunday open. Many, many thanks Mladen, you are a real star.

 

Would I be pushing my luck if I asked for a wav. sound alert, but ONLY when all five are 'in a line'? Users choice of sound input

Reason: