Hi, I get an error regarding an unbalanced parenthesis. I've even numbered them, and they seem to match. Perhaps I am missign something. Help would be appreciated. Thanks
if((MathAbs(SRlevel - Close[0]) <= Accuracy){// :6One too many ( right after "if "
One too many ( right after "if "
Thanks! Problem solved:)
I have a problem with unbalanced parenthesis too.
//+------------------------------------------------------------------+
//| MACrossover.mq4 |
//| Copyright 2019, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link "https://www.metaquotes.net"
extern int TakeProfit=50;
extern int StopLoss=25;
extern int FastMA=5;
extern int FastMaShift=0;
extern int FastMaMethod=0;
extern int FastMaAppliedTo=0;
extern int SlowMA=21;
extern int SlowMaShift=0;
extern int SlowMaMethod=0;
extern int SlowMaAppliedTo=0;
extern double LotSize=0.01;
extern int MagicNumber =2121;
double pips;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
double ticksize = MarketInfo(Symbol(),MODE_TICKSIZE);
if (ticksize == 0.00001 || ticksize==0.001)
pips = ticksize*10;
else pips=ticksize;
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
double PreviousFast = iMA(NULL,0,FastMA,FastMaShift,FastMaMethod,FastMaAppliedTo,2);
double CurrentFast = iMA(NULL,0,FastMA,FastMaShift,FastMaMethod,FastMaAppliedTo,1);
double PreviousSlow = iMA(NULL,0,SlowMA,SlowMaShift,SlowMaMethod,SlowMaAppliedTo,2);
double CurrentSlow = iMA(NULL,0,SlowMA,SlowMaShift,SlowMaMethod,SlowMaAppliedTo,1);
if (PreviousFast<PreviousSlow && CurrentFast>CurrentSlow)
if(OrdersTotal()==0)
OrderSend(Symbol(),OP_BUY,LotSize,Ask,3,Ask-(StopLoss*pips),Ask+(TakeProfit*pips),NULL,MagicNumber,0,Green);
if (PreviousFast>PreviousSlow && CurrentFast<CurrentSlow)
if(OrdersTotal()==0)
OrderSend(Symbol(),OP_SELL,LotSize,Bid,3,Bid+(StopLoss*pips),Bid-(TakeProfit*pips),NULL,MagicNumber,0,Red);
//----
return(0);
}
//+------------------------------------------------------------------+
- www.mql5.com
- 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
Messages Editor - You can't define a function inside another function.
int init() { double ticksize = MarketInfo(Symbol(),MODE_TICKSIZE); ⋮ else pips=ticksize; int deinit() {
- You should stop using the old event handlers and IndicatorCounted and start using the new ones.
Event Handling Functions - Functions - Language Basics - MQL4 Reference
How to do your lookbacks correctly.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, I get an error regarding an unbalanced parenthesis. I've even numbered them, and they seem to match. Perhaps I am missign something. Help would be appreciated. Thanks