打印本文
關閉窗口
[求助]麻煩老師了
作者:文華財經 來源:cxh99.com 發布時間:2018年04月06日
咨詢內容:
?麻煩老師改成文化可用的
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;}
//再次入場的代碼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
?
?來源:程序化99
文華技術人員:
?我們提供程序化軟件MQ,類似C語言的語法結構,兼容了您上面模型的語法,簡單修改后即可使用
您下載MQ試下,如果您不會改,我們再幫您分析下
MQ地址?https://mq.wenhua.com.cn/
?
?
?來源: www.tumamayizhan.com
文華客服:
?老師,復制到MQ還是不行,提示
文件名:sgz1g(od(zuhecco5}s4icc.png
?麻煩老師改為MQ可以用的
?
網友回復:
參考:
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;
}
//再次入場的代碼
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
打印本文
關閉窗口
主站蜘蛛池模板:
亚洲人成无码网站久久99热国产
|
国产成人+综合亚洲+天堂
|
出轨的女人hd中文字幕
|
国产性夜夜春夜夜爽三级
|
国产黑丝袜在线
|
久久天天躁狠狠躁夜夜不卡
|
欧美污视频网站
|
免费a在线观看
|
久草视频免费在线
|
国产羞羞视频在线播放
|
chinese中国农村夫tube
|
成人午夜私人影院入口
|
久久久久久久久久国产精品免费
|
波多野结衣电影免费在线观看
|
天天躁日日躁狠狠躁av中文
|
中文字幕影片免费在线观看
|
日韩乱码在线观看
|
亚洲AV永久无码天堂网
|
欧美乱大交xxxxxbbb
|
亚洲日本久久一区二区va
|
波多野结衣久久
|
国产亚洲综合色就色
|
精品福利视频导航
|
国产精品亚洲欧美大片在线观看
|
亚洲精品亚洲人成在线
|
一区二区三区中文字幕
|
日韩中文字幕免费观看
|
久夜色精品国产一区二区三区
|
欧美一卡2卡3卡4卡免费
|
亚洲国产精品久久久久秋霞小
|
美女破处在线观看
|
国产乱人伦无无码视频试看
|
无限资源日本免费2018
|
久久精品国产99久久久古代
|
日韩高清第一页
|
九九热在线视频播放
|
深夜爽爽动态图无遮无挡
|
免费观看一级毛片
|
韩国三级大全久久网站
|
大肉大捧一进一出好爽视频mba
|
yellow字幕网在线91pom国产
|