} // 当前多头,要求反转为空头 if(sc) {
if(BarStatus==2)tradePrice= Q_BidPrice -splitDot; Else tradePrice=ll-splitDot;
// 平多头开空
SellShort(maxLots,tradePrice); } //持仓处理,止损止盈平仓 //........ }
//----------------------------------------------------------------------------------------------- Else
if(MarketPosition < 0 ) {
// 当前空仓,加空头
If(sc And BarsSinceLastEntry>minSpt) {
if(BarStatus==2)tradePrice= -splitDot; Else tradePrice=ll-splitDot;
SellShort(maxLots,tradePrice); } // 当前空头,要求反转为多头 if(bc) {
if(BarStatus==2) Q_AskPrice +splitDot; Else tradePrice=hh+splitDot; //平空头,开多
Buy(maxLots,tradePrice);
}
//持仓处理,止损止盈平仓 //........ }
} } End
//------------------------------------------------------------------------ // 编译版本 GS2004.06.12 // 用户版本 2008/11/18 18:49 // 版权所有 fish0451
Q_BidPrice tradePrice= // 更改声明 TradeBlazer Software保留对TradeBlazer平台
// 每一版本的TrabeBlazer公式修改和重写的权利 //------------------------------------------------------------------------
网友回复:
2定义时间段内高低点的函数: vars
NumericSeries TmpHiLine; Begin
If(Date!=Date[1]) {
TmpHiLine = InvalidNumeric; }else {
TmpHiLine = TmpHiLine[1]; }
If(Time >= 0.1100 && Time <= 0.1120) {
If(TmpHiLine == InvalidNumeric ) TmpHiLine = High; else
TmpHiLine = max(High,TmpHiLine ); }
PlotNumeric(\End
一个30分钟突破的日内系统
这个系统我认为缺乏一个有效的过滤器会造成很多无效突破,在过滤器中最简单有效的是交易时段过滤器正如我前面提到的有效突破总是集中在一天中的某一时段呈正态分布向两边展开。通过时间过滤器可以大大提高系统的成功率和稳定性。希望高手添加一下。
Params
Numeric nMins(30); // N分钟的突破
Numeric nOffset(3); // 突破式的价格偏移 Vars
NumericSeries HighestOf30Min; NumericSeries lowestOf30Min; Numeric myPrice; Numeric MinPoint; Numeric lots(1); Begin
MinPoint = MinMove*PriceScale; If(Date <> Date[1]) {
HighestOf30Min = High; lowestOf30Min = Low;
}Else If(Time < 0.0900+nMins*0.0001) {
HighestOf30Min = max(high,HighestOf30Min[1]); lowestOf30Min = min(Low,lowestOf30Min[1]); }Else {
HighestOf30Min = HighestOf30Min[1]; lowestOf30Min = lowestOf30Min[1]; }
If(High >= HighestOf30Min + nOffset*MinPoint && MarketPosition != 1) {
myPrice = HighestOf30Min + nOffset*MinPoint; If(Open > myPrice) myPrice = Open; Buy(lots,myPrice); }
If(Low <= lowestOf30Min - nOffset*MinPoint && MarketPosition != -1) {
myPrice = lowestOf30Min - nOffset*MinPoint; If(Open < myPrice) myPrice = Open; SellShort(lots,myPrice); }
If(Time >= 0.1459) {
Sell(lots,Open);
BuyToCover(lots,Open); } End
开拓者thermostat系统源码
源码内容:
inputs:
bollingerlengths(50), trendliqlength(50), numstddevs(2), swingprcnt1(0.50), swingprcnt2(0.75), atrlength(10),
swingtrendswitch(20); vars:
cmival(0),
buyeasierday(0), selleasierday(0), trendlokbuy(0), trendloksell(0), keyofday(0), swingbuypt(0), swingsellpt(0), trendbuypt(0), trendsellpt(0), swingprotstop(0);
cmival=choppymarketindex(30); buyeasierday=0; selleasierday=0;
trendlokbuy=average(low,3); trendloksell=average(high,3);
keyofday=(high+low+close)/3;
if(close>keyofday) then selleasierday=1; if(close<=keyofday) then buyeasierday=1;
if(buyeasierday=1) then begin
swingbuypt=open of tomorrow + swingprcnt1*avgtruerange(atrlength); swingsellpt=open of tomorrow - swingprcnt2*avgtruerange(atrlength);
end;
if(selleasierday=1) then begin
swingbuypt=open of tomorrow + swingprcnt2*avgtruerange(atrlength); swingsellpt=open of tomorrow - swingprcnt1*avgtruerange(atrlength); end;
swingbuypt=maxlist(swingbuypt,trendlokbuy); swingsellpt=minlist(swingsellpt,trendloksell);
trendbuypt=bollingerband(close,bollingerlengths,numstddevs); trendsellpt=bollingerband(close,bollingerlengths,-numstddevs);
if(cmival if(marketposition<>1) then buy(\ stop; if(marketposition<>-1) then sellshort(\ swingsellpt stop; end else begin swingprotstop=3*avgtruerange(atrlength); buy(\ sellshort(\ sell from entry(\ stop; buytocover from entry(\ average(close,trendliqlength) stop; sell from entry(\ stop; buytocover from entry(\ swingprotstop stop; end; 开拓者盈多亏交易策略源码 简称: JY // 名称:盈多亏少 // 类别: 公式应用 // 类型: 用户应用 //------------------------------------------------------------------------ Params 百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库国外五大股票交易系统,及其源码(4)在线全文阅读。
相关推荐: