the program won't compile

 

anyone know what causes this?

Files:
haf2.zip  9 kb
 
Subgenius:


anyone know what causes this?

Yes,  your mess of braces.

if(getHA_Value == BUY && getFisherTransform_Value == BUY && Signl != BUY && CountOrders(OP_BUY) <= 0 && if(CloseSoundOn?)  { PlaySound("Alert.wav");  } )
 

oh yea if forgot to say, i removed  && if(CloseSoundOn?){ PlaySound("Alert.wav"); } and it still wouldn't compile.

 
Subgenius:

oh yea if forgot to say, i removed  && if(CloseSoundOn?){ PlaySound("Alert.wav"); } and it still wouldn't compile.

You removed both of them ?
 
yes, delete both..
   
//-- EXECUTE: OPEN ORDER, MODIFY ORDER, OR CLOSE ORDER.
   if(getHA_Value == BUY && getFisherTransform_Value == BUY && Signl != BUY && CountOrders(OP_BUY) <= 0)
      if(!Hedge){CloseAll(Symbol(), Magic, OP_SELL, Retries, Slippage, Order_Comment);}    
      Signl = BUY; //buy order
      signls++; //objects
      EnterLong(Symbol(), Lot, Order_Comment, Loss, Profit, Magic, Retries, Slippage);
      if(SoundOn?){PlaySound("ok.wav");}
      if(DrawArrows){SetArrow(Time[0], Ask, 241, Red);}
      if(DrawEntryBars){CreateVLine("VBar" + signls, true);}
      }
   if(getHA_Value == SELL && getFisherTransform_Value == SELL && Signl != SELL && CountOrders(OP_SELL) <= 0)
      if(!Hedge){CloseAll(Symbol(), Magic, OP_BUY, Retries, Slippage, Order_Comment);}
      Signl = SELL; //sell order
      signls++; //objects
      EnterShrt(Symbol(), Lot, Order_Comment, Loss, Profit, Magic, Retries, Slippage);
      if(SoundOn?){PlaySound("ok.wav");}
      if(DrawArrows){SetArrow(Time[0], Bid, 242, Blue);}
      if(DrawEntryBars){CreateVLine("VBar" + signls, false);}
      } 
yea, a couple of times metaeditor actually crashed, and i was able to run debug in visual studio 2012 - and i was then able to continue using metaeditor and I didnt loose any changes and could compile
 
Subgenius:
yes, delete both..
yea, a couple of times metaeditor actually crashed, and i was able to run debug in visual studio 2012 - and i was then able to continue using metaeditor and I didnt loose any changes and could compile


Where is your opening  {   brace after this line ?

if(getHA_Value == BUY && getFisherTransform_Value == BUY && Signl != BUY && CountOrders(OP_BUY) <= 0)

 I can't follow your brace formatting style,  it seems that you can't either,  perhaps you should change style ?

 

This compiles . . .

   if(getHA_Value == BUY && getFisherTransform_Value == BUY && Signl != BUY && CountOrders(OP_BUY) <= 0 && CloseSoundOn?)
      {
      PlaySound("Alert.wav");
      
      if(!Hedge){CloseAll(Symbol(), Magic, OP_SELL, Retries, Slippage, Order_Comment);}    
      Signl = BUY;
      signls++;
      EnterLong(Symbol(), Lot, Order_Comment, Loss, Profit, Magic, Retries, Slippage);
      if(SoundOn?){PlaySound("ok.wav");}
      if(DrawArrows){SetArrow(Time[0], Ask, 241, Red);}
      if(DrawEntryBars){CreateVLine("VBar" + signls, true);}
      }
   if(getHA_Value == SELL && getFisherTransform_Value == SELL && Signl != SELL && CountOrders(OP_SELL) <= 0 && CloseSoundOn?)
      {
      PlaySound("Alert.wav");
      
      
      if(!Hedge){CloseAll(Symbol(), Magic, OP_BUY, Retries, Slippage, Order_Comment);}
      Signl = SELL;
      signls++;
      EnterShrt(Symbol(), Lot, Order_Comment, Loss, Profit, Magic, Retries, Slippage);
      if(SoundOn?){PlaySound("ok.wav");}
      if(DrawArrows){SetArrow(Time[0], Bid, 242, Blue);}
      if(DrawEntryBars){CreateVLine("VBar" + signls, false);}
      } 
 
RaptorUK:


Where is your opening  {   brace after this line ?

 I can't follow your brace formatting style,  it seems that you can't either,  perhaps you should change style ?

Like something readable
if(getHA_Value              == BUY 
&& getFisherTransform_Value == BUY 
&& Signl                    != BUY 
&& CountOrders(OP_BUY)      <= 0 
&& CloseSoundOn?
   ){
Reason: