Need help with Ea that will not live demo trade? - page 2

 
//Buy
   if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
      if(!IsTrade) {
         //Check free margin
         if (AccountFreeMargin() < (1000 * Lots)) {
            Print("We have no money. Free Margin = ", AccountFreeMargin());
            return(0);
         }

         if (UseStopLoss) StopLossLevel = Ask - StopLoss * Point; else StopLossLevel = 0.0;
         if (UseTakeProfit) TakeProfitLevel = Ask + TakeProfit * Point; else TakeProfitLevel = 0.0;

         Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, 0, 0, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);
          if(Ticket > 0) {
            if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {
                                Print("BUY order opened : ", OrderOpenPrice());
                if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Open Buy");
                        } else {
                                Print("Error opening BUY order : ", GetLastError());
                        }
         }
         if (EachTickMode) TickCheck = True;
         if (!EachTickMode) BarCount = Bars;
         return(0);
      }
   }
 
You didn't add in the OrderModify, so you currently have an order placed with a SL of 0 and TP of 0 . . the OrderModify adds the TP and SL in . . look at the code I posted yesterday.
 

When add this code in i get an error "end of program unbalanced left parenthesis." message thats why i have not got it fixed.

Does this look correct now?

   //Sell
   if (Order == SIGNAL_SELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
      if(!IsTrade) {
         //Check free margin
         if (AccountFreeMargin() < (1000 * Lots)) {
            Print("We have no money. Free Margin = ", AccountFreeMargin());
            return(0);
         }

         if (UseStopLoss) StopLossLevel = Bid + StopLoss * Point; else StopLossLevel = 0.0;
         if (UseTakeProfit) TakeProfitLevel = Bid - TakeProfit * Point; else TakeProfitLevel = 0.0;

         Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, 0, 0, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DeepPink);
          if(Ticket > 0) {
             if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {
      Print("BUY order opened : ", OrderOpenPrice());
      if (!OrderModify(OrderTicket(), OrderOpenPrice(), StopLossLevel, TakeProfitLevel)
         Print("OrderModify failed: ticket= ",OrderTicket(), " error= ", GetLastError());

                        }
         }
         if (EachTickMode) TickCheck = True;
         if (!EachTickMode) BarCount = Bars;
         return(0);
      }
   }

   if (!EachTickMode) BarCount = Bars;

   return(0);
 
Chanley:
!EachTickMode && (Bars != BarCount)))) {

Should be (EachTickMode || (Bars != BarsCount))


Bars is unreliable, once you read max bars on chart it doesn't change. Volume is unreliable, you can miss ticks. Always use time

static Time0;
EachTickMode && (Time0 != Time[0]){ Time0 = Time[0]; ...
 

Thanks for your help! I don't understand and i cant make it work. The only thing that i could do from here is copy and paste the code in cause im to lost and hopeless . Thanks anyhow!

 
how to link sign up in dreamweaver
Reason: