·ÖÎö¼Ò¹«Ê½Íø,Ìṩ¹ÉƱ¹«Ê½,¹ÉƱÈí¼þÓû§µÇ¼  |  Óû§ ×¢²á
exp_Amstell-SL Ö¸±êÔ´Âë[MT4¹«Ê½]
  • Èí¼þ´óС£º0 Bytes
  • ÍƼöÐǼ¶£º
  • ¸üÐÂʱ¼ä£º2013-02-09 00:59:15
  • Èí¼þÀà±ð£º ¹ú²úÈí¼þ / MT4Ö¸±ê
  • Èí¼þÓïÑÔ£º¼òÌåÖÐÎÄ
  • ÊÚȨ·½Ê½£º Ãâ·Ñ°æ
  • ÁªÏµ·½Ê½£ºÔÝÎÞÁªÏµ·½Ê½
  • ¹Ù·½Ö÷Ò³£º Home Page
  • µã»÷´óͼ£º  ¡¾Ò»¼üתÌûµ½ÂÛ̳¡¿
  • ²å¼þÇé¿ö£º
  • ÔËÐл·¾³£ºWin9X/Win2000/WinXP/Win2003/
  • Ïà¹ØTags£ºÖ¸±ê¹«Ê½ ¹ÉƱÈí¼þ,¹«Ê½Ô´Âë
  • (0)0%
    (0)0%

Èí¼þ½éÉÜ

//+------------------------------------------------------------------+
//|                                                  exp_Amstell.mq4 |
//|                                   Copyright � 2009, Yuriy Tokman |
//|                                            www.cxh99.com |
//+------------------------------------------------------------------+
#property copyright "Copyright � 2009, Yuriy Tokman"
#property link      "yuriytokman@gmail.com"


extern int    TakeProfit       = 30;           
extern int    StopLoss         = 30;         
extern double Lots             = 0.01;    
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
  
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
  
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
  int Magic=0;
 
for(int cnt=0;cnt<OrdersTotal();cnt++)// Ïåðåáèðàåì âñ� îðäåðà
     {
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);//îðäå� âûáèðàåò�ÿ ñðåä� îòêðûòûõ � îòëîæåííûõ îðäåðî�
      if( OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)// Ñîâïàäàå� ëè ñèìâîë îðäåðà( Çäåñ� ïî íàäîáíîñòè åù� ìàãè� ìîæí� ïðîâåðèò�)
        {
         if(OrderType()==OP_BUY)//Îòáèðàåì ïîçèöè� áà�
           {
            if(Bid-OrderOpenPrice()>TakeProfit*Point || OrderOpenPrice()-Ask>StopLoss*Point)//
              {
               OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); //çàêðûâàå� îðäå�
               return(0); // âûõîäè�
              }//StopLoss
           }
          if(OrderType()==OP_SELL)//Îòáèðàåì ïîçèöè� ñåëë
           {
            if(OrderOpenPrice()-Ask>TakeProfit*Point || Bid-OrderOpenPrice()>StopLoss*Point)//
              {
               OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); //çàêðûâàå� îðäå�
               return(0); // âûõîäè�
              }
           }
         }
      }
//----
 int buy = 0, sell = 0;
//----
   if(!ExistPositions(NULL,OP_BUY))buy=1;
   else if(PriceOpenLastPos(NULL,OP_BUY)-Ask>10*Point)buy=1;
  
   if(!ExistPositions(NULL,OP_SELL))sell=1;
   else if(Bid-PriceOpenLastPos(NULL,OP_SELL)>10*Point)sell=1;  
//----
    if(buy==1)
    OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"",0,0,Green);
   
    if(sell==1)
    OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"",0,0,Red);
//----
   return(0);
  }
bool ExistPositions(string sy="", int op=-1, int mn=-1, datetime ot=0) {
  int i, k=OrdersTotal();

  if (sy=="0") sy=Symbol();
  for (i=0; i<k; i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
      if (OrderSymbol()==sy || sy=="") {
        if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
          if (op<0 || OrderType()==op) {
            if (mn<0 || OrderMagicNumber()==mn) {
              if (ot<=OrderOpenTime()) return(True);
            }
          }
        }
      }
    }
  }
  return(False);
}
double PriceOpenLastPos(string sy="", int op=-1, int mn=-1) {
  datetime t;
  double   r=0;
  int      i, k=OrdersTotal();

  if (sy=="0") sy=Symbol();
  for (i=0; i<k; i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {

Èí¼þÆÀÂÛÆÀÂÛÄÚÈÝÖ»´ú±íÍøÓѹ۵㣬Óë±¾Õ¾Á¢³¡Î޹أ¡

   ÆÀÂÛÕªÒª(¹² 0 Ìõ£¬µÃ·Ö 0 ·Ö£¬Æ½¾ù 0 ·Ö) ²é¿´ÍêÕûÆÀÂÛ

˵Ã÷

* ʹÓ÷½·¨£ºµã»÷ÉÏÃæÀ¶É«¿é£¬´ò¿ªÐÂÒ³Ãæ°´ÕÕÌáʾ½øÐÐ

* ±¾ÍøÕ¾ÌṩµÄ¸÷ÖÖ¹ÉƱÈí¼þ£¬ÀýÈç´óÖÇ»ÛÈí¼þ£¬Í¨´ïÐÅÈí¼þ£¬Í¬»¨Ë³Èí¼þ£¬¶«·½²Æ¸»Í¨µÈµÈ£¬ºÍ¸÷ÖÖ¹ÉƱ¹«Ê½Ö¸±ê£¬ÀýÈç´óÖǻ۹«Ê½£¬Í¨´ïÐŹ«Ê½£¬Í¬»¨Ë³¹«Ê½£¬ÎÄ»ª¹«Ê½£¬²©Ò×´óʦ¹«Ê½£¬¹ÉƱ¼Û¸ñ¼ÆË㹫ʽµÈµÈ¹«Ê½Ö¸±êµÈ£¬¶¼À´Ô´ÍøÉϹ«¿ªÀ´Ô´ÊÕ¼¯

±¾ÍøÌṩµÄ¹«Ê½Îļþ˵Ã÷£º
* alg¸ñʽ·Éºü¹ÉƱ¹«Ê½£¬¿ÉÒÔÓ÷ɺü½»Ò×ʦ»òÕß½»Ò×ʦÈí¼þµ¼È룻
* fnc¸ñʽ´óÖÇ»ÛÐÂÒ»´ú¹«Ê½Ö¸±ê£¬¿ÉÒÔÓôóÖǻ۹ÉƱÈí¼þʹÓã¬ÉÙ²¿·Ö¿ÉÒÔÓ÷ÖÎö¼Ò¹ÉƱÈí¼þÒýÈëʹÓã»
* exp¸ñʽ´óÖǻ۾­µä°æ¹ÉƱ¹«Ê½£¬½ö¿ÉÒÔÓôóÖǻ۾­µä°æ¹ÉƱÈí¼þÒýÈëʹÓã»
* tniºÍtnc¸ñʽͨ´ïÐŹÉƱ¹«Ê½£¬½ö¿ÉÒÔÓÃͨ´ïÐÅÐÂÒýÈëʹÓã¬ÀýÈç¿ÉÒÔÓÃͨ´ïÐŹÉƱÈí¼þÒýÈëʹÓã»
* tne£¬tn6¸ñʽͨ´ïÐŹ«Ê½£¬¿ÉÒÔÓÃͨ´ïÐŹ«Ê½±à¼­Æ÷5.0°æµ¼È룬ÍƼöͨ´ïÐŽðÈÚÖն˰汾£»
* hxf¸ñʽͬ»¨Ë³¹ÉƱ¹«Ê½£¬½ö¿ÉÒÔÓÃͬ»¨Ë³¹ÉƱÈí¼þÒýÈëʹÓá£
ÒÔÉϵĸ÷ÖÖÈí¼þ¶¼¿ÉÒÔÔÚ±¾Íø¹ÉƱÈí¼þÀ¸Ä¿ÕÒµ½!

* ¹ØÓÚ¹ÉƱ¹«Ê½Ê±¼äÏÞÖÆ,Èç¹ûÔÚÒýÈë´óÖǻ۹«Ê½£¬½»Ò×ʦ¹«Ê½»òÕ߷ɺü¹«Ê½µÄʱºò£¬·¢ÏÖ¹«Ê½Ãû³ÆÀ¸Êǿհ׵ģ¬Õâʱºòµ÷ÕûµçÄÔʱ¼äµ½1997Ä꣬ÓÖÄܳöÏÖ¹«Ê½Ãû³Æ£¬²¢ÇÒÄÜÕý³£ÏÔʾ£¬¿ÉÄÜÊǹ«Ê½Ê¹ÓÃÆÚÏÞÒѹý¡£
* ¹ØÓÚ»¹Ô­¹«Ê½Ô´ÂëÈç¹ûÄãÍü¼ÇÁË×Ô¼º±àдµÄ´óÖǻ۹«Ê½£¬Í¨´ïÐŹ«Ê½£¬Í¬»¨Ë³¹«Ê½,²ÙÅÌÊÖ¹«Ê½,·Éºü¹«Ê½£¬²©Ò×´óʦ¹«Ê½£¬½ð×ÖËþ¹«Ê½£¬ÎÄ»ª¹«Ê½ºÍ½»Ò×ʦ¹«Ê½µÈµÈ¹«Ê½µÄÃÜÂ룬±¾Íø¿É°ï»Ö¸´Ô´Â룬ÓÐ.³¥.·þ.ÎñÎÞÒâÎðÈÅ£¬µã»÷ÔÚÏß×ÉѯÁªÏµÎÒ¡£

* ¹ØÓÚ¹ÉƱ¹«Ê½Ô´Âë±à¼­
±¾ÍøÌṩµÄÔ´Â룬һ°ã¶¼¿ÉÒԱ༭³É¹«Ê½£¬Èç¹û²»Ã÷°×¹«Ê½µÄ±à¼­£¬ÔÚ±¾Ò³ÓÒ²à½Ì³Ì¼Ïñ¿É²Î¿¼£¬»òÕßÕÒ¹«Ê½½Ì³Ì×ÊÁÏѧϰ£¬ÇëËÑË÷£º½Ì³Ì

* Èç¹ûÄú·¢ÏÖÈí¼þÄÚÈÝ»òÕßÁ´½Ó´íÎó£¬Çëµã»÷±¨¸æ´íÎóлл£¡
* Õ¾ÄÚÌṩµÄËùÓÐÈí¼þ°üº¬Ô´Âë¾ùÊÇÓÉÍøÉÏËѼ¯£¬ÈôÇÖ·¸ÁËÄãµÄ°æȨÀûÒ棬ÇëÁªÏµÍ¨ÖªÎÒÃÇ!

¹ØÓÚ±¾Õ¾ | ÍøÕ¾°ïÖú | ¹ã¸æºÏ×÷ | ÉùÃ÷ | ÓÑÇéÁ¬½Ó | ÍøÕ¾µØͼ |
·ÖÎö¼Ò¹«Ê½ÍøÉùÃ÷£º±¾Õ¾ËùÓйÉƱ¹«Ê½Èí¼þ×ÊÁϾùÍøÉϹ«¿ªÊÕ¼¯£¬ÈçÇÖȨÇëÁªÏµÉ¾Ìû¡£Õ¾ÄÚËùÓйã¸æ£¬¾ùÓë±¾Õ¾Î޹أ¡
Copyright © 2003-2024 70822.Com. All Rights Reserved .
Ò³ÃæÖ´ÐÐʱ¼ä£º7,390.62500 ºÁÃë