Testing new OrderSend()

To add comments, please log in or register
GrumpyDuckMan
882
GrumpyDuckMan  

Hello Everyone,

I not really sure if this code would be more effective than having two functions for Ask and Bid orders. I am wondering if anyone has tried everything even remotely resembling this.



//+-------------------------------------------------------------------------------------------------------------------------------------------------+
  bool TradeSelect()
  {
   ticket=OrderSend
  (
   Security,      
   TradeType[op],      // op      [0]OP_BUY [1]OP_SELL
   Price[price],       // price   [0]0.01 [1]0.02 [2]0.03 [3]0.04 [4]0.05 [5]1.00 [6]2.00 [7]3.00 [8]4.00 [9]5.00
   pos[Select],        // Select  [0]ASK  [1]BID 
   Slippage,
   stoploss,
   TakeProfit[profit], // profit  [0]Ask Profit Set [1]Bid Profit Set [2]No Profit Set
   Comments[Remarks],  // Remarks [0]"Buy Position" [1]"Sell Position" 
   Magic_Number,
   expiration,
   colours[colour]     // colour  [0] clrBlue [1] clrRed
   );

   if(ticket<0)
     {
   return(errorlevel=(GetLastError()));
   }
   else   errorlevel=(GetLastError()); 
   
   return(errorlevel);
   }
//+-------------------------------------------------------------------------------------------------------------------------------------------------+
Keith Watford
Moderator
20422
Keith Watford  
What exactly are you trying to achieve?
GrumpyDuckMan
882
GrumpyDuckMan  
Keith Watford:
What exactly are you trying to achieve?

Hello again,

Well simplified, I am trying to achieve some flexibility in a single function.

//+------------------------------------------------------------------+

int OrderTotals()
  {
   for(Ticket_Shift=OrdersTotal();Ticket_Shift>=0; Ticket_Shift--)
     {
      bool Trade=OrderSelect(Ticket_Shift,SELECT_BY_POS)==false;
      Order_Ticket=OrderTicket();
      Ticket[Ticket_Shift]=Order_Ticket;
     }
   return(List);
  }
//+------------------------------------------------------------------+

This is meant to tell me about orders already opened.  The program is still being reviewed.

To add comments, please log in or register