Coding help - page 421

 
mrtools:
NWFstudent does it still alert on open bar, if alertsonCurrent=false?

Oh, I was sure that meant alert on current pair. Havent tried, will try it today.

Thanks alot

 
Su407:
Dear Meta Coder,

May I make a request here? (Sorry if wrong place)

I would like to trouble you to mix this 2 indicator of vertical line together and also add every hour vertical line that can change color and style. (As shown yellow line in attach picture which I draw it manually)

Thanks in advance for your great help.

Appreciate your time dedicated.

Best regards

Su407

In my experience it is almost always better to have tasks like that separated. That way you can have more combinations and easier to use indicator (less parameters - sometimes when there are too much parameters it is difficult to find out what some parameter does)

 
mladen:
Su407 In my experience it is almost always better to have tasks like that separated. That way you can have more combinations and easier to use indicator (less parameters - sometimes when there are too much parameters it is difficult to find out what some parameter does)

Thanks for suggestion mladen,

Do you have an indicator for hourly vertical line separately?

 

hello house....

I want someone to help out, I have been using the ea I attached below most especially on Demo. I coded this ea to always take maximum of 5 trades, but despite all my code editting and corrections, this ea will continue to take more than the said number of trades...kindly help out.Can someone really tell me the problem with this ea!

Files:
 

Hi MQL Pro-Coders,

I wonder if someone could help me. I am working on an EA around the "Hull moving average 2 strict nmc" indicator.

I figured out that just parameter "3" (trend) is working after the 3rd candle was formed, would it be possible

to have the second candle as signal candle as well?

Could the signal candle be set in the HMA Speed parameter?

extern string TimeFrame = "Current time frame";

extern int HMAPeriod = 35;

extern int HMAPrice = PRICE_CLOSE;

extern double HMASpeed = 2.0;

extern bool alertsOn = false;

extern bool alertsOnCurrent = true;

extern bool alertsMessage = true;

extern bool alertsSound = false;

extern bool alertsEmail = false;

[/CODE]

CODE to open the trades:

I want also implement an "just one trade per running trend function" to avoid the system open trades

after the profit target was reached on the current trend, because the trend may change afterwards.

Could a coder please review my code?

[CODE]

extern double maxshorttrades = 1;

extern double maxlongtrades = 1;

extern int HMA_Period=21;

extern int HMA_Price=0; //PRICE_CLOSE;

extern double HMA_Speed= 2;

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

//| ORDER Logic / Indicators |

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

if(openedOrders<=0)

{

double CCIFilter = iCCI(NULL,0,CCIPeriod,CCIMethod,0);

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

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

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

//| BUY |

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

for (i=OrdersTotal()-1;i>=0; i--)

if(OrderType()==OP_BUY && OP_BUY<maxlongtrades) break; // Check Traded Positions.

{

if(trendc!=trendp)

{

if(trendc==1 && (CCIFilter<50)) // code for buy

OpenBuy();

return(0);

}

openedOrders++;

}

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

//| SELL |

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

for (i=OrdersTotal()-1;i>=0; i--)

if(OrderType()==OP_SELL && OP_SELL<maxshorttrades) break; // Check Traded Positions.

{

if(trendc==-1 && (CCIFilter>50)) // code for sell

{

OpenSell();

return(0);

}

openedOrders++;

}

}

Thank you in advance!

With kind regards,

TFI

 
tfi_markets:
Hi MQL Pro-Coders,

I wonder if someone could help me. I am working on an EA around the "Hull moving average 2 strict nmc" indicator.

I figured out that just parameter "3" (trend) is working after the 3rd candle was formed, would it be possible

to have the second candle as signal candle as well?

Could the signal candle be set in the HMA Speed parameter?

extern string TimeFrame = "Current time frame";

extern int HMAPeriod = 35;

extern int HMAPrice = PRICE_CLOSE;

extern double HMASpeed = 2.0;

extern bool alertsOn = false;

extern bool alertsOnCurrent = true;

extern bool alertsMessage = true;

extern bool alertsSound = false;

extern bool alertsEmail = false;

[/CODE]

CODE to open the trades:

I want also implement an "just one trade per running trend function" to avoid the system open trades

after the profit target was reached on the current trend, because the trend may change afterwards.

Could a coder please review my code?

[CODE]

extern double maxshorttrades = 1;

extern double maxlongtrades = 1;

extern int HMA_Period=21;

extern int HMA_Price=0; //PRICE_CLOSE;

extern double HMA_Speed= 2;

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

//| ORDER Logic / Indicators |

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

if(openedOrders<=0)

{

double CCIFilter = iCCI(NULL,0,CCIPeriod,CCIMethod,0);

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

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

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

//| BUY |

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

for (i=OrdersTotal()-1;i>=0; i--)

if(OrderType()==OP_BUY && OP_BUY<maxlongtrades) break; // Check Traded Positions.

{

if(trendc!=trendp)

{

if(trendc==1 && (CCIFilter<50)) // code for buy

OpenBuy();

return(0);

}

openedOrders++;

}

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

//| SELL |

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

for (i=OrdersTotal()-1;i>=0; i--)

if(OrderType()==OP_SELL && OP_SELL<maxshorttrades) break; // Check Traded Positions.

{

if(trendc==-1 && (CCIFilter>50)) // code for sell

{

OpenSell();

return(0);

}

openedOrders++;

}

}

Thank you in advance!

With kind regards,

TFI

TFI

Buffer 3 is the correct one (that is the "trend" buffer that has values 1 for up slope and -1 for down slope). You are using shifts 1 and 2, hence it is testing the 1st closed bar.

Buy part of the code is OK.

You left out the

if(trendc!=trendp)

from the sell part ant that might be causing you a problem

 

Hi Mladen,

some months ago you created for me this indicator CARBON for mt5 wich display the distance in % from sma 15.

Now,please, can create the same indicator but displayng distance in pips?

thank's in advance

p.s.sorry but today I have difficulties to upload on this forum.....and I cant open MT5 forum session.....if you have Carbon..ok..otherwise I will try later to upload it.

finally I write on mt5 session.....sorry for this post

 

hello Mladen...

I want someone to help out, I have been using the ea I attached below most especially on Demo. I coded this ea to always take maximum of 5 trades, but despite all my code editting and corrections, this ea will continue to take more than the said number of trades...kindly help out.Can someone really tell me the problem with this ea!

Files:
 
Mastercash:
hello Mladen... I want someone to help out, I have been using the ea I attached below most especially on Demo. I coded this ea to always take maximum of 5 trades, but despite all my code editting and corrections, this ea will continue to take more than the said number of trades...kindly help out.Can someone really tell me the problem with this ea!

Did you try setting the Lotsparameter to 5 and UseMoneyManagementto false?

 

I set the use moneymanagement to false.... but about Lots parameters, it is not about the Lots but the number of open orders.I dont want the ea to open more than 5 orders......at a given time, that is why I set NumberofTrades parameter to 5, on the input parameters but it will still dare me, and take more than 5 orders, thereby threaten my moneymanagements!

mladen:
Did you try setting the Lotsparameter to 5 and UseMoneyManagementto false?