發(fā)一個交易系統(tǒng),大家繼續(xù)完善 - TradeBlazer公式 [開拓者 TB]
作者:
開拓者 TB 來源:
cxh99.com 發(fā)布時間:2012年06月01日 點擊數(shù):
【
收藏到本網的會員中心】
- 咨詢內容:
本帖最后由 zbh0912 于 2012-4-20 14:16 編輯
//------------------------------------------------------------------------
// 簡稱: CS
// 名稱: 優(yōu)化
// 類別: 公式應用
// 類型: 用戶應用
// 輸出:
//------------------------------------------------------------------------
Params
Numeric Length(10);
Numeric NumATRs(1);
Numeric profipoint(200);
Numeric trailingstop(0.3);
Vars
NumericSeries TPrice;
NumericSeries AvgValue;
NumericSeries ShiftValue;
Numeric UpperBand;
Numeric LowerBand;
Numeric MyEntryPrice;
Numeric MyExitPrice;
NumericSeries HighestAfterEntry;
NumericSeries LowestAfterEntry;
Begin
If(BarsSinceentry == 0)
{
HighestAfterEntry = Close;
LowestAfterEntry = Close;
If(MarketPosition <> 0)
{
HighestAfterEntry = Max(HighestAfterEntry,AvgEntryPrice);
LowestAfterEntry = Min(LowestAfterEntry,AvgEntryPrice);
}
}
else
{
HighestAfterEntry = Max(HighestAfterEntry,High);
LowestAfterEntry = Min(LowestAfterEntry,Low);
}
Commentary("HighestAfterEntry="+Text(HighestAfterEntry));
Commentary("LowestAfterEntry="+Text(LowestAfterEntry));
//MinPoint = MinMove*PriceScale;
MyEntryPrice = AvgEntryPrice;
TPrice = (High[1]+Low[1]+Close[1])/3;
AvgValue = AverageFC(TPrice,Length);
ShiftValue = NumATRs*AvgTrueRange(Length);
UpperBand = AvgValue + ShiftValue[1];
LowerBand = AvgValue - ShiftValue[1];
PlotNumeric("UpperBand",UpperBand);
PlotNumeric("LowerBand",LowerBand);
PlotNumeric("MidLine",AvgValue);
If(MarketPosition==0)
{
If(High >= UpperBand)
{
MyEntryPrice = UpperBand;
If(Open > MyEntryPrice) MyEntryPrice = Open;
Buy(1,MyEntryPrice);
}
If(Low <= LowerBand)
{
MyEntryPrice = LowerBand;
If(Open < MyEntryPrice) MyEntryPrice = Open;
SellShort(1,MyEntryPrice);
}
}
If(MarketPosition==1)
{
If(Close[1]<AvgValue[1])
{
MyExitPrice=Open;
Sell(0,MyExitPrice);
}
Else if(HighestAfterEntry[1]>=myEntryPrice+profipoint*MinMove*PriceScale)
{
If(Low<=HighestAfterEntry[1]-trailingstop*(HighestAfterEntry[1]-myEntryPrice))
{
MyExitPrice=HighestAfterEntry[1]-trailingstop*(HighestAfterEntry[1]-myEntryPrice);
MyExitPrice=IntPart(MyExitPrice/MinMove*PriceScale)*MinMove*PriceScale;
if(Open<MyExitPrice) MyExitPrice=Open;
Sell(0,MyExitPrice);
}
}
}
Else if(MarketPosition==-1)
{
if(Close[1]>AvgValue[1])
{
MyExitPrice=Open;
BuyToCover(0,MyExitPrice);
}
Else if(LowestAfterEntry[1]<=AvgEntryPrice-profipoint*MinMove*PriceScale)
{
If(High>=LowestAfterEntry[1]+trailingstop*(myEntryPrice-LowestAfterEntry[1]))
{
MyExitPrice=LowestAfterEntry[1]+trailingstop*(myEntryPrice-LowestAfterEntry[1]);
MyExitPrice=IntPart(MyExitPrice/MinMove*PriceScale)*MinMove*PriceScale;
if(Open>MyExitPrice) MyExitPrice=Open;
BuyToCover(0,MyExitPrice);
}
}
}
End
//------------------------------------------------------------------------
// 編譯版本 GS2010.12.08
// 用戶版本 2012/04/17 13:22
// 版權所有 zbh0912
// 更改聲明 TradeBlazer Software保留對TradeBlazer平臺
// 每一版本的TrabeBlazer公式修改和重寫的權利
//------------------------------------------------------------------------
- TB技術人員:
請問LZ,這個模型是肯特納通道系統(tǒng)么?
- TB客服:
樓主的系統(tǒng)是在什么時間周期上的啊,5min測試是負的,日線和30分鐘還可以,但是也不是特別好。
下面是三十分鐘,小時和日線的測試圖。是交易成本考慮進去的結果。
cv是英語什么的簡稱?
- 網友回復:
這群不活躍呀:):)
- 網友回復:
200個點止贏 應該不是短線
 
|