the program won't compile

To add comments, please log in or register
Brian Lillard
5547
Brian Lillard  

anyone know what causes this?

Files:
haf2.zip 9 kb
Simon Gniadkowski
17660
Simon Gniadkowski  
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");  } )
Brian Lillard
5547
Brian Lillard  

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

Simon Gniadkowski
17660
Simon Gniadkowski  
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 ?
Brian Lillard
5547
Brian Lillard  
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
Simon Gniadkowski
17660
Simon Gniadkowski  
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 ?

Simon Gniadkowski
17660
Simon Gniadkowski  

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);}
      } 
William Roeder
18276
William Roeder  
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?
   ){
To add comments, please log in or register