對於程式語言一直抱持排斥的心態,所以無法好好地靜下心學好
交易已經進展到『程式自動交易』非走不可的階段,看看如何能快速又簡單進入
先來學習別人的,多看並利用一些好工具,來簡化學習的曲線
//+------------------------------------------------------------------+
//|
//|
//+------------------------------------------------------------------+
#define MAGICMA
extern double Lots
extern double MaximumRisk
extern double DecreaseFactor
extern double MovingPeriod
extern double MovingShift
//+------------------------------------------------------------------+
//| Calculate open positions
//+------------------------------------------------------------------+
int CalculateCurrentOrders(string symbol)
//----
//---- return orders volume
//+------------------------------------------------------------------+
//| Calculate optimal lot size
//+------------------------------------------------------------------+
double LotsOptimized()
//---- select lot size
//---- calcuulate number of losses orders without a break
//---- return lot size
//+------------------------------------------------------------------+
//| Check for open order conditions
//+------------------------------------------------------------------+
void CheckForOpen()
//---- go trading only for first tiks of new bar
//---- get Moving Average
//---- sell conditions
//---- buy conditions
//----
//+------------------------------------------------------------------+
//| Check for close order conditions
//+------------------------------------------------------------------+
void CheckForClose()
//---- go trading only for first tiks of new bar
//---- get Moving Average
//----
//----
//+------------------------------------------------------------------+
//| Start function
//+------------------------------------------------------------------+
void start()
//---- check for history and trading
//---- calculate open orders by current symbol
//----
//+------------------------------------------------------------------+
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
以下是註解
//+------------------------------------------------------------------+
//|
//|
//+------------------------------------------------------------------+
#define MAGICMA
extern double Lots
extern double MaximumRisk
extern double DecreaseFactor
extern double MovingPeriod
extern double MovingShift
//+------------------------------------------------------------------+
//| Calculate open positions
//+------------------------------------------------------------------+
int CalculateCurrentOrders(string symbol)//函數作用,計算當前持倉訂單的數量
//----
//---- return orders volume
//+------------------------------------------------------------------+
//| Calculate optimal lot size
//+------------------------------------------------------------------+
double LotsOptimized()//函數目的,根據要求 計算出訂單交易量
//---- select lot size
//---- calcuulate number of losses orders without a break
//---- return lot size
//+------------------------------------------------------------------+
//| Check for open order conditions
//+------------------------------------------------------------------+
void CheckForOpen()//檢查入場條件的情況並作處理
//---- go trading only for first tiks of new bar
//---- get Moving Average
//---- sell conditions
//---- buy conditions
//----
//+------------------------------------------------------------------+
//| Check for close order conditions
//+------------------------------------------------------------------+
void CheckForClose()//檢查出場條件的情況並作處理
//---- go trading only for first tiks of new bar
//---- get Moving Average
//----
//----
//+------------------------------------------------------------------+
//| Start function
//+------------------------------------------------------------------+
void start()//主循環過程
//---- check for history and trading
//---- calculate open orders by current symbol
//----
//+------------------------------------------------------------------+
- Oct 08 Tue 2013 11:32
EA自動智能交易系統(範例說明)
全站熱搜
留言列表