[求助]麻煩老師了 [文華財(cái)經(jīng)]

  • 咨詢內(nèi)容: ?麻煩老師改成文化可用的
    Params? ? ? Numeric Length(40);? ? ? Numeric NumATRs(1); ?Numeric Offset(1); ?Numeric ATRLength(10); ?Numeric TrailingStart(1); ?Numeric StopLossSet(4); ?Numeric TrailingStop(3);Vars? ? ? NumericSeries TPrice;? ? ? Numeric AvgValue;? ? ? NumericSeries ShiftValue;? ? ? Numeric UpperBand;? ? ? Numeric LowerBand;? ? ? Numeric MyPrice; ?Numeric UpLine; //上軌 ?Numeric DownLine; //下軌? ?NumericSeries MidLine; //中間線 ?Numeric Band; ?NumericSeries HigherAfterEntry; ?NumericSeries LowerAfterEntry; ?Numeric DayOpen; ?Numeric StopLine; ?BoolSeries bLongTrailingStoped;? ? ? BoolSeries bShortTrailingStoped; ?Numeric MinPoint;Begin? ? ?MinPoint = MinMove*PriceScale;? ? ?DayOpen=AvgEntryPrice; TPrice=(High[1]+Low[1]+Close[1])/3;? ? ?AvgValue=AverageFC(TPrice,Length);? ? ?ShiftValue=NumATRs*AvgTrueRange(ATRLength);? ? ?UpperBand=AvgValue+ShiftValue[1];? ? ?LowerBand=AvgValue-ShiftValue[1]; MidLine = AverageFC(Close,Length); Band = StandardDev(Close,Length,2);? UpLine = MidLine + Offset * Band; DownLine = MidLine - Offset * Band;? ?If(BarStatus > 0){ bLongTrailingStoped = bLongTrailingStoped[1]; bShortTrailingStoped = bShortTrailingStoped[1];}Commentary("bLTrue","False"));Commentary("bShortTrailingStoped="+IIFString(bShortTrailingStoped,"True","False"));
    If(BarsSinceEntry==1){? ? HigherAfterEntry=AvgEntryPrice;? ? LowerAfterEntry=HigherAfterEntry;}Else// If(BarsSinceEntry>1){? ? ? ?HigherAfterEntry=max(HigherafterEntry[1],High[1]);? ? ? ?LowerAfterEntry=min(LowerAfterEntry[1],Low[1]);}If(bLongTrailingStoped==False && MarketPosition!=1&&High>=UpperBand)? ?{? ? ? MyPrice=UpperBand;? ? ? If(Open>MyPrice)MyPrice=Open;? ? ? Buy(1,MyPrice); ?bLongTrailingStoped=True; ?bShortTrailingStoped=False;? ? ? Return;? ?}If(bShortTrailingStoped==False && MarketPosition!=-1&&Low<=LowerBand){? ? ?MyPrice=LowerBand;? ? ?If(Open<MyPrice)MyPrice=Open;? ? ?SellShort(1,MyPrice);? bShortTrailingStoped=True; bLongTrailingStoped=False;? ? ?Return;}If(HigherAfterEntry>=AvgEntryPrice+DayOpen*TrailingStart*0.01&&MarketPosition==1){? ? ? ?StopLine=HigherAfterEntry-DayOpen*TrailingStop*0.01;}Else//止損{? ? ? ?StopLine=UpperBand-DayOpen*StopLossSet*0.01;}If(Low<=StopLine){? ? ? ?MyPrice=StopLine;? ? ? ?If(Open<MyPrice)MyPrice=Open;? ? ? ?Sell(1,MyPrice); ? bLongTrailingStoped=True; ? bShortTrailingStoped=False;? ? ? ?Return;}If(LowerAfterEntry<=AvgEntryPrice-DayOpen*TrailingStart*0.01&&MarketPosition==-1){? ? ? ?StopLine=LowerAfterEntry+DayOpen*TrailingStop*0.01;}Else//止損{? ? ? ?StopLine=LowerBand+DayOpen*StopLossSet*0.01;}
    If(High>=StopLine){? ? ? ?MyPrice=StopLine;? ? ? ?If(Open>MyPrice)MyPrice=Open;? ? ? ?Buytocover(1,MyPrice); bShortTrailingStoped=True; bLongTrailingStoped=False;? ? ? ?Return;}

    //再次入場(chǎng)的代碼If(bLongTrailingStoped && MarketPosition==0 && High > HigherAfterEntry){ MyPrice = HigherAfterEntry + MinPoint; If(Open > MyPrice) MyPrice = Open; Buy(1,MyPrice); bLongTrailingStoped = False; bShortTrailingStoped= True; Return;}If(bShortTrailingStoped && MarketPosition==0 && Low < LowerAfterEntry){ MyPrice = LowerAfterEntry - MinPoint; If(Open < MyPrice) MyPrice = Open; SellShort(1,MyPrice); bLongTrailingStoped = True; bShortTrailingStoped= False; Return;}End

    ?

    ?來(lái)源:程序化99

  • 文華技術(shù)人員: ?我們提供程序化軟件MQ,類似C語(yǔ)言的語(yǔ)法結(jié)構(gòu),兼容了您上面模型的語(yǔ)法,簡(jiǎn)單修改后即可使用
    您下載MQ試下,如果您不會(huì)改,我們?cè)賻湍治鱿?br style="line-height: 22px;" />MQ地址?https://mq.wenhua.com.cn/
    ?

    ?

    ?來(lái)源: www.tumamayizhan.com

  • 文華客服: ?老師,復(fù)制到MQ還是不行,提示


    文件名:sgz1g(od(zuhecco5}s4icc.png
    ?麻煩老師改為MQ可以用的

    ?

  • 網(wǎng)友回復(fù): 參考:
    Params ? ? ? Numeric Length(40); ? ? ? Numeric NumATRs(1);
    ?Numeric Offset(1);
    ?Numeric ATRLength(10);
    ?Numeric TrailingStart(1);
    ?Numeric StopLossSet(4);
    ?Numeric TrailingStop(3); Vars ? ? ? NumericSeries TPrice; ? ? ? Numeric AvgValue; ? ? ? NumericSeries ShiftValue; ? ? ? Numeric UpperBand; ? ? ? Numeric LowerBand; ? ? ? Numeric MyPrice;
    ?Numeric UpLine; //上軌
    ?Numeric DownLine; //下軌?
    ?NumericSeries MidLine; //中間線
    ?Numeric Band;
    ?NumericSeries HigherAfterEntry;
    ?NumericSeries LowerAfterEntry;
    ?Numeric DayOpen;
    ?Numeric StopLine;
    ?NumericSeries bLongTrailingStoped; ? ? ? ?NumericSeries bShortTrailingStoped;
    ?Numeric MinPoint; Begin ? ? ?MinPoint = MinMove*PriceScale; ? ? ?DayOpen=AvgEntryPrice;
    TPrice=(High[1]+Low[1]+Close[1])/3; ? ? ?AvgValue=AverageFC(TPrice,Length); ? ? ?ShiftValue=NumATRs*AvgTrueRange(ATRLength); ? ? ?UpperBand=AvgValue+ShiftValue[1]; ? ? ?LowerBand=AvgValue-ShiftValue[1];
    MidLine = AverageFC(Close,Length);
    Band = StandardDev(Close,Length,2);?
    UpLine = MidLine + Offset * Band;
    DownLine = MidLine - Offset * Band;?
    ? If(BarStatus > 0) {
    bLongTrailingStoped = bLongTrailingStoped[1];
    bShortTrailingStoped = bShortTrailingStoped[1]; } //Commentary("bLTrue,"False")); Commentary("bShortTrailingStoped="+IIFString(bShortTrailingStoped,"True","False"));

    If(BarsSinceEntry==1) { ? ? HigherAfterEntry=AvgEntryPrice; ? ? LowerAfterEntry=HigherAfterEntry; }Else// If(BarsSinceEntry>1) { ? ? ? ?HigherAfterEntry=max(HigherafterEntry[1],High[1]); ? ? ? ?LowerAfterEntry=min(LowerAfterEntry[1],Low[1]); } If(bLongTrailingStoped==0&& MarketPosition!=1&&High>=UpperBand) ? ?{ ? ? ? MyPrice=UpperBand; ? ? ? If(Open>MyPrice)MyPrice=Open; ? ? ? Buy(1,MyPrice);
    ?bLongTrailingStoped=1;
    ?bShortTrailingStoped=0; ? ? ? Return; ? ?} If(bShortTrailingStoped==0 && MarketPosition!=-1&&Low<=LowerBand) { ? ? ?MyPrice=LowerBand; ? ? ?If(Open<MyPrice)MyPrice=Open; ? ? ?SellShort(1,MyPrice);?
    bShortTrailingStoped=1;
    bLongTrailingStoped=0; ? ? ?Return; } If(HigherAfterEntry>=AvgEntryPrice+DayOpen*TrailingStart*0.01&&MarketPosition==1) { ? ? ? ?StopLine=HigherAfterEntry-DayOpen*TrailingStop*0.01; }Else//止損 { ? ? ? ?StopLine=UpperBand-DayOpen*StopLossSet*0.01; } If(Low<=StopLine) { ? ? ? ?MyPrice=StopLine; ? ? ? ?If(Open<MyPrice)MyPrice=Open; ? ? ? ?Sell(1,MyPrice);
    ? bLongTrailingStoped=1;
    ? bShortTrailingStoped=0; ? ? ? ?Return; } If(LowerAfterEntry<=AvgEntryPrice-DayOpen*TrailingStart*0.01&&MarketPosition==-1) { ? ? ? ?StopLine=LowerAfterEntry+DayOpen*TrailingStop*0.01; }Else//止損 { ? ? ? ?StopLine=LowerBand+DayOpen*StopLossSet*0.01; }
    If(High>=StopLine) { ? ? ? ?MyPrice=StopLine; ? ? ? ?If(Open>MyPrice)MyPrice=Open; ? ? ? ?Buytocover(1,MyPrice);
    bShortTrailingStoped=1;
    bLongTrailingStoped=0; ? ? ? ?Return; }

    //再次入場(chǎng)的代碼 If(bLongTrailingStoped && MarketPosition==0 && High > HigherAfterEntry) {
    MyPrice = HigherAfterEntry + MinPoint;
    If(Open > MyPrice) MyPrice = Open;
    Buy(1,MyPrice);
    bLongTrailingStoped = 0;
    bShortTrailingStoped=1;
    Return; } If(bShortTrailingStoped && MarketPosition==0 && Low < LowerAfterEntry) {
    MyPrice = LowerAfterEntry - MinPoint;
    If(Open < MyPrice) MyPrice = Open;
    SellShort(1,MyPrice);
    bLongTrailingStoped = 1;
    bShortTrailingStoped= 0;
    Return; } End

 

有思路,想編寫(xiě)各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友

可聯(lián)系技術(shù)人員 QQ: 511411198  點(diǎn)擊這里給我發(fā)消息進(jìn)行 有償 編寫(xiě)!不貴!點(diǎn)擊查看價(jià)格!


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

相關(guān)文章

    沒(méi)有相關(guān)內(nèi)容
主站蜘蛛池模板: 久久99九九国产免费看小说| 免费精品久久久久久中文字幕| 69国产成人精品午夜福中文| 好痛太长太深弄死我了视频| 久久不见久久见免费视频7| 2022国产麻豆剧果冻传媒剧情| 欧美在线精品一区二区在线观看| 偷窥自拍10p| 精品无码中文视频在线观看| 国产免费黄色片| 久久6这里只有精品| 国产精品无码av一区二区三区| 999国产精品999久久久久久| 好大好硬别停老师办公室视频| 两个体校校草被c出水| 日产精品一二三四区国产| 久久精品亚洲日本波多野结衣| 李老汉的性生生活2| 亚洲国产精品久久久久秋霞小| 毛片毛片毛片毛片毛片毛片| 人妻精品无码一区二区三区| 精品一区二区三区在线观看视频 | 久久久精品人妻一区二区三区| 明星ai人脸替换造梦在线播放| 亚洲乱码日产精品BD在线观看| 欧美日韩亚洲精品国产色| 亚洲欧美色一区二区三区| 波多野结衣一级片| 亚洲色av性色在线观无码| 电梯里吸乳挺进我的身体视频| 免费无码又爽又刺激毛片| 精品久久综合1区2区3区激情| 午夜亚洲乱码伦小说区69堂| 精品调教CHINESEGAY| 另类人妖交友网站| 精品无码一区二区三区爱欲九九| 又紧又大又爽精品一区二区| 综合久久久久久中文字幕| 台湾三级全部播放| 精品福利三区3d卡通动漫| 午夜小视频在线|