Trading libraries for MetaTrader 4

Special Offer!

Time Left to Buy:

Up to 25% OFF

Shopping cart

The cart is empty

MetaTrader 4

Top Rated Products MT4

999 $749 $ AI Gen XII MT4
Denis Kurnev
4 5 4 Product
999 $749 $ Nmt5
Liang Qi Quan
4.5 5 2 Product
2 199 $1 649 $ Ak47tutu
Dian Zhou
4.5 5 2 Product

K Trade Lib Pro 4

k-trade-lib-pro-4-logo-200x200-9424
89 $67 $

Free updates are included

We accept crypto: BTC, ETH, BCH and more...

30-Day Money Back Guarantee
100% Guarantee of Originality

Information

Libraries
MetaTrader 4
Kaijun Wang
2.0
5

Overview

MT4/5通用交易库(  一份代码通用4和5 )

#ifdef __MQL5__ 
    #define KOD_TICKET ulong 
    #define KOD_MAGIC  long 
#else  
    #define KOD_TICKET long 
    #define KOD_MAGIC  int 
#endif 
class ODLIST;
 
#import "K Trade Lib Pro 4.ex4"   
   //祝有个美好开始,运行首行加入
   void StartGood() ; 
   //简单开单
   long OrderOpen(int type,double volume,int magic,string symbol="",string comment="",double opprice=0,double sl=0,double tp=0,int expiration=0,bool slsetmode=false,bool tpsetmode=false);
   //复杂开单
   void SetMagic(int magic,int magic_plus=0);
   void SetLotsAddMode(int mode=0,double lotsadd=0);
   long OrderOpenAdvance(int mode,int type,double volume,int step,int magic,string symbol="",string comment="",double sl=0,double tp=0,bool slsetmode=false,bool tpsetmode=false);
   
   //平仓函数
   bool K_OrderClose(int type,KOD_MAGIC magic,string symbol="",int is_profit=0,double profit_value=0,bool ispoint=false );
   
   //订单详细获取.
   int  OrderTotal(int type=0,KOD_MAGIC magic=-1,string symbol="");
   ODLIST* OrderLowPrice(int type=0,KOD_MAGIC magic=-1,string symbol="");
   ODLIST* OrderHighPrice(int type=0,KOD_MAGIC magic=-1,string symbol="");
   ODLIST* OrderLowTime(int type=0,KOD_MAGIC magic=-1,string symbol="") ;
   ODLIST* OrderHighTime(int type=0,KOD_MAGIC magic=-1,string symbol="") ;
#import


class ODLIST{
       //order information 
   private:
       //datetime ctrl_time;
       ODLIST  m_list[];
       ODLIST* m_parent; 
   public:
       
       
       int     m_total; 
       int     m_total_vir;
       ODLIST* m_sort_price[];
       ODLIST* m_sort_time[];
        
       KOD_TICKET      ticket;
       int      type;
       long     op_time;
       long     close_time;
       double   lots;
       double   op_price;
       double   close_price;  
       double   sl;
       double   tp;
       string   symbol;
       double   profit;
       double   commission; //获取总手续费 MT5无效
       double   swap;
       long     expiration;
       KOD_MAGIC magic;
       string   comment; 
       
       long     flag1;
       long     flag2;
       string   m_memo;
};

2.复杂订单系统开单(包含逆势加仓,顺势加仓,随机间距加仓; 手数增加模式有倍数模式,增量模式,以及固定手数模式)

void SetMagic(
   int magic,        //设置MAGIC,本设置是针对需要统计订单所对应的魔术号
   int magic_plus=0  //可以设置范围  当 (魔术号>=magic ,魔术号<=magic+magic_plus) 的范围内的魔术号订单都会作为统计 
);
void SetLotsAddMode(
   int mode=0,          //1->倍数开仓  2->增量开仓 ,0或者其他->固定手数下面参数设置无效
   double lotsadd=0     //根据mode设置而定,倍率手数本参数为倍率,增量模式为增量,否则无效
);
long OrderOpenAdvance(
   int mode,         //0x1 逆势加仓,0x2顺势加仓,0x4间距随机加仓 
   int type,         //交易类型 0->BUY 1->SELL
   double volume,    //固定手数 
   int step,         //加仓间距
   int magic,        //魔术号
   string symbol="", //品种
   string comment="",//注释 
   double sl=0,      //止损设置(默认设置点数)
   double tp=0,      //止盈设置(默认设置点数)
   bool slsetmode=false,//false为sl点数设置,true为sl价格模式
   bool tpsetmode=false //false为tp点数设置,true为tp价格模式
);

交易范例:(马丁逆势加仓)  非常简单实现马丁加仓,同样可以简单的实现顺势加仓等

void OnTick()
  {
//--- 

      SetLotsAddMode(1,2.0);
      int mode=1;//逆势加仓模式
      int type=0;//0为多单,1为空单  同系统方式
      double lots=0.01; //手数设置
      int step=200; //加仓间距
      int magic =556024;//设置魔术号
      
      OrderOpenAdvance(mode,type,lots,step,magic);
  }





Recently Viewed

500 $375 $ HeLL Cat Pro
Dmitry Lukyanov
99 $74 $ Price Action Toolkit
LEE SAMSON
99 $74 $ Risk Calculator Panell
Mykhailo Krygin
Results 1 - 3 of 3

30-Day Money Back Guarantee

If for any reason you do not like the purchased program, you can request a refund within 30 days from the date of purchase. You can also make an exchange for any other product at an equal cost or by paying the difference.
Simply send a request for refund or exchange with your order number by email: [email protected].
Refund requests received more than 30 days after purchase will be rejected.

Email Us Now! Support is available 24/7
by Email: [email protected]

Do You Need Help?
Click Here To Start Live Chat

Contact Us

Image

Search