雙均線 EA交易模型(指數(shù)移動(dòng)均線和一條調(diào)整移動(dòng)均線)[開(kāi)拓者公式]
作者:開(kāi)拓者 TB 來(lái)源:網(wǎng)上轉(zhuǎn)載 發(fā)布時(shí)間:2012年12月18日 點(diǎn)擊數(shù):
4010
【收藏到本網(wǎng)的會(huì)員中心】
- 內(nèi)容: 給大家一個(gè)雙均線交易模型,歡迎大家試用指教 僅供參考或作范例之用。
源碼:
//------------------------------------------------------------------------
// 簡(jiǎn)稱: EA
// 名稱: EA交易模型
// 類別: 交易指令
// 類型: 其他
// 輸出: 一條指數(shù)移動(dòng)均線和一條調(diào)整移動(dòng)均線(適應(yīng)性移動(dòng)平均線)
//------------------------------------------------------------------------
Params
Numeric Length1(16);
Numeric Length2(80);
Numeric FastAvgLength(2);
Numeric SlowAvgLength(30);
Vars
NumericSeries AMA;
NumericSeries EMA;
Bool Condition1;
Bool Condition2;
Numeric TotalEquity;
Numeric UseMargin;
Numeric EntryLots;
Begin
TotalEquity = CurrentCapital()+ Abs(CurrentContracts()*Close*ContractUnit()*BigPointValue()*MarginRatio());
UseMargin = Close*ContractUnit*BigPointValue*MarginRatio;
EntryLots = IntPart(TotalEquity*0.25/UseMargin);
AMA = AdaptiveMovAvg(Close,Length1,FastAvgLength,SlowAvgLength);
EMA = XAverage(Close, Length2);
if (AMA>EMA)
{
Buy(EntryLots,NextOpen,True);
}
if (EMA>AMA)
{
SellShort(EntryLots,NextOpen,True);
}
End
//------------------------------------------------------------------------
// 編譯版本 GS2004.06.12
// 用戶版本 2010/07/26 13:21
// 版權(quán)所有 mmc29170
// 更改聲明 TradeBlazer Software保留對(duì)TradeBlazer平臺(tái)
// 每一版本的TrabeBlazer公式修改和重寫的權(quán)利
//------------------------------------------------------------------------
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 262069696 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容