您現(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)容
主站蜘蛛池模板: 一级毛片视频播放| 亚洲精品成人区在线观看| 992人人tv| 国产色秀视频在线观看| 一区二区三区视频在线观看| 日批免费观看视频| 二区久久国产乱子伦免费精品| 欧美日韩亚洲综合| 人妻少妇精品无码专区二区| 精品熟女少妇av免费久久| 国产丰满麻豆videossexhd| 国产一区二区三区乱码网站| 国产精品无码一区二区在线 | 亚洲国产精品无码久久青草| 特级毛片www| 免费v片在线看| 精品伊人久久久香线蕉| 又黄又爽又色又刺激的视频| 耻辱の女潜入搜查官正在播放 | 四虎成人免费大片在线| 调教双乳玉势揉捏h捆绑小说| 国产小视频免费观看| 久碰人澡人澡人澡人澡人视频 | 久久久www免费人成精品| 日本高清视频色wwwwww色| 久久超碰97人人做人人爱| 春暖花开亚洲性无区一区二区| 亚洲a视频在线观看| 欧美一区二区三区精品影视| 亚洲国产成人综合| 欧美成人中文字幕dvd| 亚洲欧洲综合网| 欧美极品少妇×XXXBBB| 亚洲欧美日韩精品中文乱码| 正点嫩模大尺度写真在线视频| 亚洲精品电影在线| 沈婷婷小雷第三次| 亚洲欧美日韩综合俺去了| 欧美熟妇另类久久久久久多毛| 亚洲欧美四级在线播放| A∨变态另类天堂无码专区|