您現(xiàn)在的位置:程序化交易>> 期貨公式>> 金字塔等>> 金字塔知識(shí)>>正文內(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  點(diǎn)擊在線交流或微信號(hào):cxh99cxh99  進(jìn)行 有償收費(fèi) 編寫!

怎么收費(fèi),代編流程等詳情請(qǐng)點(diǎn)擊閱讀!

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


【字體: 】【打印文章】【查看評(píng)論

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 2021国内精品久久久久久影院| 69式互添免费视频| 中文字幕在线免费| 亚洲熟妇色xxxxx欧美老妇| 亚洲色成人网一二三区| 国产aⅴ一区二区| 国产一区二区三区久久精品| 噜噜噜在线视频| 人人妻人人爽人人澡人人| 亚洲欧美日韩自偷自拍| 再深点灬舒服灬太大了男小| 免费h黄肉动漫在线观看| 亚洲国产成人久久一区www| 久久久国产精品| 久热综合在线亚洲精品| 久久久久久九九精品久小说| 久久精品无码午夜福利理论片| 亚洲大片免费观看| 亚洲第一页在线视频| 亚洲一级免费毛片| 久久99精品国产免费观看 | 国产麻豆精品原创| 性欧美wideos| 日本一区二区三区四区五区 | 亚洲视频欧美视频| 久久综合久久精品| 一级午夜a毛片免费视频| 1819sextub欧美中国| 91freevideos精品| 99久久精品费精品国产| 中文字幕38页| 1卡二卡三卡四卡精品| 色香视频在线观看| 色综合天天综合网国产成人 | 91传媒蜜桃香蕉在线观看| 草草影院www色欧美极品| 污视频在线网站| 欧美激情视频一区二区| 欧美日韩国产一区二区| 欧美乱大交XXXXX疯狂俱乐部| 欧美成a人片在线观看久|