對於程式語言一直抱持排斥的心態,所以無法好好地靜下心學好
交易已經進展到『程式自動交易』非走不可的階段,看看如何能快速又簡單進入
先來學習別人的,多看並利用一些好工具,來簡化學習的曲線
//+------------------------------------------------------------------+
//|
Moving Average.mq4 |
//| http://www.imt4.com |
//+------------------------------------------------------------------+
#define MAGICMA 20050610
extern double Lots = 0.1;
extern double MaximumRisk = 0.02;
extern double DecreaseFactor = 3;
extern double MovingPeriod = 10;
extern double MovingShift =3;
//+------------------------------------------------------------------+
//| Calculate open positions |
//+------------------------------------------------------------------+
int CalculateCurrentOrders(string symbol)
{
int buys=0,sells=0;
//----
for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;
if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGICMA)
{
if(OrderType()==OP_BUY) buys++;
if(OrderType()==OP_SELL) sells++;
交易已經進展到『程式自動交易』非走不可的階段,看看如何能快速又簡單進入
先來學習別人的,多看並利用一些好工具,來簡化學習的曲線
//+------------------------------------------------------------------+
//|
//|
//+------------------------------------------------------------------+
#define MAGICMA
extern double Lots
extern double MaximumRisk
extern double DecreaseFactor
extern double MovingPeriod
extern double MovingShift
//+------------------------------------------------------------------+
//| Calculate open positions
//+------------------------------------------------------------------+
int CalculateCurrentOrders(string symbol)
//----