您現(xiàn)在的位置:程序化交易>> 期貨公式>> 金字塔等>> 金字塔知識>>正文內(nèi)容

修改一下 [金字塔]

咨詢內(nèi)容: Params
Numeric ATime(918);
Numeric CTime(1510);
Numeric Lot(1);
Numeric MoneyLoss(0.6);
Numeric BarCross(1);
Numeric Length(5);

Vars
Numeric bTime(0);
Numeric MyClose(0);
Numeric MyDiff(0);
NumericSeries estP(0);
NumericSeries ExitP(0);
NumericSeries Position(0);
NumericSeries est(0);
NumericSeries est1(0);
NumericSeries est2(0);
NumericSeries est3(0);

Bool bTimeCon;
Bool BarUpCon;
Bool BarDownCon;
Bool BarExitCon;
Bool LongOpenCon;
Bool ShortOpenCon;
Bool LongExitCon;
Bool ShortExitCon;

Begin

If (Date != Date[1])
{
est = Open;
est1 = Open;
est2 = Open;
est3 = Open;
estP = 0;
ExitP = 0;
Position = 0;
MyClose = Open;
}
Else
{
est = est[1];
est1 = est1[1];
est2 = est2[1];
est3 = est3[1];
estP = estP[1];
ExitP = ExitP[1];
Position = Position[1];
If(Length != 0) MyClose = Average(Close[1],Length);
Else MyClose = Close[1];
}

MyDiff = MyClose * BarCross / 1000;

bTime = IntPart(Time*10000);
bTimeCon = (bTime > ATime) And (bTime < CTime);

If((MyClose < est And MyClose < est1) Or (MyClose > est And MyClose > est1)) est = MyClose;
If(((MyClose - est) > MyDiff And est < est1) Or ((est - MyClose) > MyDiff And est > est1))
{
est3 = est2;
est2 = est1;
est1 = est;
est = MyClose;
}

If(Position > 0 And High > estP) estP = High;
If(Position < 0 And Low < estP) estP = Low;
If(Position > 0) ExitP = estP * (100 - MoneyLoss) / 100;
If(Position < 0) ExitP = estP * (100 + MoneyLoss) / 100;

If(bTime >= CTime)
{
If (Position > 0)
Sell(lot,Open);
Else
BuyToCover(lot,Open);
}

If(bTimeCon)
{
If (Position == 0)
{
If(est3 < est1 And (est2 / 2000 + est2) <= est And est3 < est2)
{
Buy(lot,Open);
Position = lot;
estP = Open;
ExitP = estP * (100 - MoneyLoss) / 100;
Commentary("LongOpen");

}

Else If(est3 > est1 And (est2 - est2 / 2000) >= est And est3 > est2)
{
SellShort(lot,Open);
Position = lot * -1;
estP = Open;
ExitP = estP * (100 + MoneyLoss) / 100;
Commentary("ShortOpen");
}
}

Else

{
If(Position > 0 And est3 > est1)
{
Sell(lot,Open);
Position = 0;
Commentary("LongExit1");
}

Else If(Position < 0 And est3 < est1)
{
BuyToCover(lot,Open);
Position = 0;
Commentary("ShortExit1");
}

Else If(Position > 0 And Open < ExitP)
{
Sell(lot,Open);
Position = 0;
Commentary("LongExit2");
}

Else If(Position < 0 And Open > ExitP)
{
BuyToCover(lot,Open);
Position = 0;
Commentary("ShortExit2");
}
}
}

Commentary("Position = "+Text(Position));?來源: www.tumamayizhan.com 金字塔資深技術(shù): 抱歉,能力有限修改不了,這種語法結(jié)構(gòu)我們不熟。建議你考慮提供邏輯思路,我們嘗試提供代碼范例。

 

有思路,想編寫各種指標(biāo)公式,交易模型,選股公式,還原公式的朋友

可聯(lián)系技術(shù)人員 QQ: 262069696  點擊在線交流或微信號:cxh99cxh99  進(jìn)行 有償收費 編寫!

怎么收費,代編流程等詳情請點擊閱讀!

(注:由于人數(shù)限制,QQ或微信請選擇方便的一個聯(lián)系我們就行,加好友時請簡單備注下您的需求,否則無法通過。謝謝您!)


【字體: 】【打印文章】【查看評論

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 在线观看毛片网站| 欧美成人免费一级人片| 日本肉漫在线观看| 人妻无码αv中文字幕久久琪琪布| 91香蕉在线视频| 欧美双茎同入视频在线观看| 另类ts人妖专区| 日本三级韩国三级欧美三级| 怡红院亚洲怡红院首页| 亚洲色欲色欲综合网站| 青春草在线视频观看| 怡红院av一区二区三区| 乱子伦农村xxxx视频| 狂野欧美激情性xxxx在线观看| 国产不卡视频在线播放| 毛茸茸bbw亚洲人| 奶大灬舒服灬太大了一进一出| 亚洲欧美日韩一区在线观看 | 中文国产成人精品久久水| 极品丝袜乱系列在线阅读 | 91欧美在线视频| 小镇姑娘hd电影在线观看| 亚洲欧洲中文日产| 精品国产一区二区三区久久狼| 国产精品高清一区二区三区不卡| 七次郎在线视频永久地址| 日韩乱码人妻无码中文字幕视频 | 亚洲avav天堂av在线网爱情| 波多野结衣456| 国产成人精品一区二区三区免费 | 久久精品无码一区二区日韩av| 欧美精品束缚一区二区三区| 免费看片aⅴ免费大片| 中文字幕在线色| 在线观看你懂得| 久久精品噜噜噜成人av| 秋霞鲁丝片无码av| 国产三级电影在线播放| 精品久久久久久蜜臂a∨| 工囗番漫画全彩无遮挡| 亚洲伊人久久大香线蕉AV|