I face a problem when writing EA - page 2

 
SRC command is on the post reply box tool..
 
GoDKillz:
i don know how to use SRC = = would u mind to teach me ??



This picture is showing you the frame you have when you write a new message on a topic of this forum

It opens a new frame

You simply copie the code you wanna show from your MetaEditor and paste it into this frame

Then push Insert and write the normal messages (text) you have

Trie out if it fails you can delete your last post so you can trie as often as you want

 
//+------------------------------------------------------------------+
//|                                                        Hedge.mq4 |
//|                      Copyright © 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   if(OrdersTotal()==0)
      {
              OrderSend(Symbol(),OP_BUY,1,Ask,50,Ask-300*Point,Ask+300*Point,"1234",0123,0,Blue);
             
      }
      
  if(OrdersTotal()==1
     && i wanna to write here, the price, is at the point under my 1st trade 's price -200* Point)
     {
             OrderSend(Symbol(),OP_SELL,1,Bid,50,Bid+300*Point,Bid-300*Point,"2345",0321,0,Red);
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+

I still miss the input parameters ...

Wanna have for SL, TP, Slippage, TradeComment, MagicNumber and what all there is needed

You don't make this way your EA. Do You ??

 
Your EA must adjust for 4/5 digit brokers (tp, sl, AND slippage.) Your EA must adjust for ECN brokers. You're not doing either.
//++++ These are adjusted for 5 digit brokers.
int     pips2points;    // slippage  3 pips    3=points    30=points
double  pips2dbl;       // Stoploss 15 pips    0.015      0.0150
int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
int     init(){                                             OptInitialization();
     if (Digits % 2 == 1){      // DE30=1/JPY=3/EURUSD=5 forum.mql4.com/43064#515262
                pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
    } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
    // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
//---- These are adjusted for 5 digit brokers.
    /* On ECN brokers you must open first and THEN set stops
    int ticket = OrderSend(..., 0,0,...)
    if (ticket < 0)
       Alert("OrderSend failed: ", GetLastError());
    else if (!OrderSelect(ticket, SELECT_BY_TICKET))
       Alert("OrderSelect failed: ", GetLastError());
    else if (!OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0))
       Alert("OrderModify failed: ", GetLastError());
     */
 
Br
deVries:
Your EA must adjust for 4/5 digit brokers (tp, sl, AND slippage.) Your EA must adjust for ECN brokers. You're not doing either.

Bro,would you mind to give me ur fb or Skype,i got something to ask u,privacy.

 
GoDKillz:


i don know how to use SRC = = would u mind to teach me ??


 
i am still confused about what this src button is and what it does. help.
 

Without using the SRC button . . .

OrderSend(Symbol(),OP_BUY,1,Ask,50,Ask-300*Point,Ask+300*Point,"1234",0123,0,Blue);

with using the SRC button and pasting the code into the box and then clicking insert . . .

OrderSend(Symbol(),OP_BUY,1,Ask,50,Ask-300*Point,Ask+300*Point,"1234",0123,0,Blue);

The code is colour coded the same way it is in the Editor . . this makes it easier to read.