
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Good morning house. please kindly help me, I have an indicator that displayed 33 warnings after compiling it, but I don`t have idea of what to change . I want to ask for permission before pasting it.
Thanks
You don't need permission to post, but start a new thread, and use Alt-S when pasting your code.
Hi I'm getting a warning - Implicit conversion to string
I have not been able to solve this warning - The indicator works but would like to have it warning free.
Any suggestions?
Hi I'm getting a warning - Implicit conversion to string
I have not been able to solve this warning - The indicator works but would like to have it warning free.
Any suggestions?
There's a line number to each warning, look that line up and examine the types of variables used - for example, if you have a = b * c, and 'a' is integer, while either b or c is double, and your 'a' cannot be double, then you'll need to change to something like a = int(b * c).
There's a line number to each warning, look that line up and examine the types of variables used - for example, if you have a = b * c, and 'a' is integer, while either b or c is double, and your 'a' cannot be double, then you'll need to change to something like a = int(b * c).
These are the lines I'm getting the error on
Line 452 - GMaxPercentDD=AccountNumber()+"_GMaxPercentDD";
Line 454 - DrawdownTime=AccountNumber()+"_DrawdownTime";
---
Not sure what I have done now as I'm getting a uninitialized Variable "MaxDrawdown.
if (WorstDrawdown<MaxDrawdown)
Think that is easy enough to fix.
Surely there must be an easier way to get Drawdown
These are the lines I'm getting the error on
Line 452 - GMaxPercentDD=AccountNumber()+"_GMaxPercentDD";
Down to 1 Warning
Down to 1 Warning
Try:
Try:
That has worked - Tried the same on the GMaxDrawdown=string(AccountNumber())+"_MaxDrawdown"; but that still returns the Number to String warning
Scratch that - I left the original string code line to copy text - it works and compile error free - Thanks so much
Hey Can someone have look into this for me. Having same issue.
if(!CheckOpenOrder(MagicNumber))
{
if(Ask >= LBBAND2 && Ask < UBBAND1 && MACDMAIN > MACDSIGNAL) //if price is between lower band 2 and upper band 1 and macd line above macd signal go long
{
Alert("Buy Now at "+ NormalizeDouble(Ask, Digits));
Alert("Take Proft at "+ NormalizeDouble(UBBAND1, Digits));
Alert("Stop Loss at "+ NormalizeDouble(LBBAND6, Digits));
OrderId = OrderSend(MySymbol, OP_BUYLIMIT, LotSize, Ask, 10, NormalizeDouble(LBBAND6, Digits), NormalizeDouble(UBBAND1, Digits), NULL, MagicNumber);
if(OrderId < 0)
Alert("The Order Could Not Be Sent, ErrorCode: " + GetLastError());
}
else
if(Bid <= UBBAND2 && Bid > LBBAND1 && MACDMAIN < MACDSIGNAL) //if price is between upper band 2 and lower band 1 and macd below signal go short
{
Alert("Sell Now at "+ NormalizeDouble(Bid, Digits));
Alert("Take Proft at "+ NormalizeDouble(LBBAND1, Digits));
Alert("Stop Loss at "+ NormalizeDouble(UBBAND6, Digits));
OrderId = OrderSend(MySymbol, OP_SELLLIMIT, LotSize, Bid, 10, NormalizeDouble(UBBAND6, Digits), NormalizeDouble(LBBAND1, Digits), NULL, MagicNumber);
if(OrderId < 0)
Alert("The Order Could Not Be Sent, ErrorCode: " + GetLastError());
}
/*else
{
Alert("Hold Your Nerve");
}*/
}
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
Messages Editor
Don't Hijack other threads for your off-topic post. Next time, make your own, new, thread.