Forex rebate kingForex rebate king

What is Forex EA And the working principle of EA


Forexrebateking that Forex rebate king ExpertAdvisors acronym in English, Chinese meaning expert advisors, commonly known as intelligent cashbackinforex system, is a computer simulation of the traders order operation for the process of automatic machine trading I. Manual manipulation process below we will take the MT4 foreign exchange client as an example, first to analyze a foreign exchange trader manual foreign exchange trading operation process: its Steps are as follows: 1, open the foreign exchange trading client, select a currency pair chart; 2, monitor the K-line trend chart of the currency pair, commonly known as staring, looking for the time to open or close a position, that is, the conditions for opening or closing a position 3, if the conditions are met, to place an order to open a position (do more or short) or close a position 4, repeat the second step Continue to stare at the plate, assuming that the second step is to open a position, which is to find the conditions for closing a position 5, if the conditions for closing a position are met, close the operation, calculate the profit cashback forex loss accounting to complete a cycle of transactions 6, if you continue to trade, repeat 2->3->4->5 steps 7, if you do not trade, exit the foreign exchange client II, machine manipulation process Based on the above analysis, we already know a complete intelligent trading system (commonly known as EA) in operation after the basic functions that must be achieved, is the above manual operation of the 1-5 steps which is the basic working process of the intelligent trading system, so the intelligent trading system works by the forexrebateindonesiamer with the help of a computer programming language, by writing program trading instructions to simulate the human trader The main execution process can be divided into: stare - > open positions - > stare again - > close positions, so the process of cyclical execution about the platform that supports automatic machine trading, currently popular in the foreign exchange market is the MetaQuotes MT4 platform, because this platform is embedded in a MQL4 language, which provides the ability to support the server-side data. It provides access to server-side data and trading operations interface, program traders can write their own automatic trading system according to their own trading strategies, so as to achieve automatic machine trading, not only to reduce the workload of humans, but also to overcome the weaknesses of human character in trading, but the current EA development, still in the early start-up phase, some still have defects, but I believe that with the development of technology, automatic machine trading will eventually But I believe that with the development of technology, automatic machine trading will eventually gradually replace the manual operation of humans will then give traders a new option III,  MQL language related knowledge In order to achieve machine operation, and then look at the required MQL4 language related knowledge:  1, master the basic syntax of the MQL4 language and the composition of the program, and the running process of the syntax part, please The reader is referred to the relevant information, which is omitted here Regarding the composition of the program, for an intelligent trading system EA program: the main three functions are:  init(): initialization function, which is responsible for the initial input of program variables and data; it is executed only once when the program is called in, and it is generally not necessary to rewrite the content deinit(): counter-initialization function, is responsible for the program exit, the data from memory clear; only in the program exit, execute once, generally do not need to rewrite the content start (): start function, that is, the main function of the program, is responsible for the EA program of all trading execution process, in fact, he is an EA trading management and execution function every certain time, generally within a few seconds, execute once, is the cycle of execution The EA is the main function of the program, which is responsible for the entire transaction execution process of the EA program, and is executed once every certain time, generally within a few seconds, is a cyclic execution, which is a cyclic execution, and is terminated when the program exits Running process: After starting the EA, the programs INTI () starts executing once, ---> then START () cyclic execution ---> and finally exits the EA when deinit () executes once 2, MQL4 trading-related trading functions:  Open position function:   intOrderSend(stringsymbol,intcmd,doublevolume,doubleprice,intslippage,doublestoploss,doubletakeprofit,voidcomment,voidmagic, voidexpiration,voidarrow_color) This function is mainly applied to open positions and pending orders trading.  parameters: symbol-trading currency pairs cmd-purchase method volume-purchase lots price-closing price slippage-maximum allowable slippage stoploss-stop loss level  takeprofit-win level comment-comment text magic-order designation code can be used as a user-specified identifier expiration-order validity time (pending orders only) arrow_color-arrow color on the chart if the parameter is missing or there is CLR_ NONE price value will not be drawn in the chart close function:  boolOrderClose(intticket,doublelots,doubleprice,intslippage,voidColor) close operation on the order if the function succeeds, the returned value is trueIf the function fails, the returned value is falseGet detailed error information, see GetLastError() function parameters: ticket-order number lots-lots price-closing price slippage-highest scratch point  Color-chart marker color if the parameters are missing, CLR_NONE value will not be drawn in the chart order modification function: boolOrderModify(intticket,doubleprice,doublestoploss,doubletakeprofit, datetimeexpiration,voidarrow_color) for the previous open or pending order to modify the characteristics of the function if the function succeeds, the returned value is TRUE if the function fails, the returned value is FALSE to get detailed error information, see GetLastError() function parameters:  nbsp;ticket-order number price-closing price stoploss-new stop level takeprofit-new win level expiration-pending order validity time arrow_color-allowed stop/win color in the chart If the parameters are lost or CLR_NONE value, the chart will not be displayed IV, the source code of the trading process analysis The following source code is a moving average based intelligent trading system code, the entire program is very simple but EA function is very complete, to achieve a completely automatic by the computer to place orders and close positions, the entire program only used a START () function to The entire program uses only one START() function to realize the program code analysis see the relevant comments in the code //+------------------------------------------------------------------+//|modifiedEA.mq4       nbsp;                            ;        |//|Copyright?2008,MetaQuotesSoftwareCorp.          nbsp;          |//|[email protected]:806935610        ;                     |//+----------------------------- -------------------------------------+  #propertylink  http://new.qzone.qq.com/806935610//----inputparameters& nbsp; extern  doubleTakeProfit=20;  extern  doubleStopLoss=30;   extern   doubleLots=2;  extern  doubleTrailingStop=50;  extern  intShortEma=5;  extern   nbsp; intLongEma=60; //+------------------------------------------------------------------+//| expertinitializationfunction                             |//+------------------------------------------------------------------+   intinit()   {       //----          //----       return(0);  }//+------------------------------------------------------------------+//| expertdeinitializationfunction                        nbsp;     |//+------------------------------------------------------------------+  intdeinit()& nbsp;  {       //----         //----      nbsp;  return(0);  } //+------------------------------------------------------------------+//| expertstartfunction                           nbsp;             |//+------------------------------------------------------- -----------+  intstart()   {      intcnt,ticket,total;         nbsp;  doubleSEma,LEma;//----       if(Bars<100)             nbsp;{         Print(barslessthan100);            return(0);      }//----        if(TakeProfit<10)        nbsp;   {          Print(TakeProfitlessthan10);           return(0);//checkTakeProfit        }//----         SEma= iMA(NULL,0,ShortEma,0,MODE_EMA,PRICE_CLOSE,0);      LEma=iMA(NULL,0,LongEma,0,MODE_EMA,PRICE_CLOSE,0 );//----       staticintisCrossed=0;       isCrossed=Crossed(LEma,SEma); //----      total=OrdersTotal();       if(total<1)         {         if(isCrossed==1)//Satisfy short position condition, open short position       ;     {              ticket=OrderSend(Symbol(),OP_SELL,Lots ,Bid,3,Bid+StopLoss*Point,                   Bid- TakeProfit*Point,EMA_CROSS,12345,0,Green);              if(ticket>0)      nbsp;         {                  nbsp;    if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))                nbsp;      Print(SELLorderopened:,OrderOpenPrice());                 }else                   Print( ErroropeningSELLorder:,GetLastError());            return(0);         nbsp;      }            if(isCrossed==2)//Satisfy the multiple position condition, open multiple positions           {              ticket=OrderSend( Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,                     Ask+TakeProfit*Point,EMA_CROSS,12345,0,Red);             if(ticket>0 )              {                 nbsp;     if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))             nbsp;        Print(BUYorderopened:,OrderOpenPrice());              nbsp;      }else                    Print( ErroropeningBUYorder:,GetLastError());            return(0);         nbsp;      }        return(0);        }//---- order modification to achieve dynamic stop-loss and stop-loss tracking      for(cnt=0;cnt<total;cnt++)              nbsp;{        OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);           nbsp;   if(OrderType()<=OP_SELL&&OrderSymbol()==Symbol())              ;  {            if(OrderType()==OP_SELL)//longpositionisopened & nbsp;           {//checkfortrailingstop                if(TrailingStop>0)                      nbsp;   {                      if(Bid- OrderOpenPrice()>Point*TrailingStop)                         nbsp;   {                          nbsp;if(OrderStopLoss()<Bid-Point*TrailingStop)                      nbsp;      {                      nbsp;        OrderModify(OrderTicket(),OrderOpenPrice(),           nbsp;                         Bid- Point*TrailingStop,                            nbsp;      OrderTakeProfit(),0,Green);                   nbsp;              &n bsp;return(0);                                nbsp;}                     }      nbsp;            }                  nbsp;  }else//gotoshortposition              {// checkfortrailingstop                   if(TrailingStop>0)  ;                  {              nbsp;        if((OrderOpenPrice()-Ask)>(Point*TrailingStop))       & nbsp;                {            nbsp;            if((OrderStopLoss()>(Ask+Point*TrailingStop))) & nbsp;                        { & nbsp;                         OrderModify(OrderTicket(),OrderOpenPrice(),                        nbsp;           Ask+Point*TrailingStop,                                  OrderTakeProfit(),0,Red);                             nbsp;    return(0);                        nbsp;     }                         nbsp; }                 }           nbsp;      }            }        nbsp; }//----       return(0);    }//+-------------------------------------- ----------------------------+   //moving average multiple short conditions judgment,  intCrossed(doubleline1,doubleline2)    & nbsp; {      staticintlast_direction=0;         staticintcurrent_ direction=0;//Don'tworkinthefirstload,waitforthefirstcross!        staticboolfirst_time=true;  ;     if(first_time==true)          {          first_time=false;         return(0);         }//----       if(line1>line2)            current_direction=2;//up long market up penetration to do long      if(line1<line2)          current_direction=1;// down short market down through shorting //----       if(current_direction!=last_direction)//changed long-short change{        nbsp;   last_direction=current_direction;       return(last_direction);  & nbsp;   else       return(0);//notchanged  } V. The conclusion of this paper from the above analysis, you can know that the so-called EA, which is made Computer simulation of the traders order operation for machine trading process, the specific steps are as follows: 1, when the user opens the foreign exchange client program, by the client program into the user in the system has been preset EA trading system program 2, when the EA program started it began to the chart of the currency pair K-line trend chart, monitoring, looking for conditions to open positions; 3, if the conditions are met, the order to open a position (do more) or short); 4, repeat the second step, continue to stare at the plate, assuming that the second step is to open a position, is to find the conditions for closing positions 5, if the conditions for closing positions are met, close the operation, calculate profit and loss accounting to complete a cycle of transactions 6, if you continue to trade, EA repeat 2-> 3-> 4-> 5 steps 7, the user does not want to let EA to trade, you can disable the EA through the relevant menu operation settings, or exit the foreign exchange client
No reproduction without permission: Forex rebate king » What is Forex EA And the working principle of EA

Related recommendations