找回密码
 注册
搜索
查看: 2415|回复: 18

[灌水] My Hit&Run system

[复制链接]
发表于 2008-5-18 01:58 PM | 显示全部楼层 |阅读模式


My swing trading system is doing good in this whipsaw market

 

Hit and Run.jpg

 

xlf.jpg

[ 本帖最后由 biorjin 于 2008-5-18 15:01 编辑 ]
发表于 2008-5-18 02:03 PM | 显示全部楼层
这是什么系统?看起来很不错。 是不是您说的POV + ADX?
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2008-5-18 02:28 PM | 显示全部楼层

No, it is very simple system based on SMA, RSI and ATRP. It was designed to "hit and run", so it is pretty good in a whipsaw market based on my backtest result. I have been using this to trade SPY, XLF, XHB recently. You can also set the stop loss to avoid big loss. Code is below

 

xhb.jpg

 

for bar:=60 to BarCount-1 do begin
   if (PriceClose(bar) > PriceClose(bar-1)) and
      (PriceClose(bar-1) > PriceClose(bar-2))
   then begin
      SellAtMarket(bar+1, #all, '')
   end else begin
      if (PriceClose(bar) < PriceClose(bar-1)) and
         (PriceClose(bar-1) < PriceClose(bar-2)) and
         (SMA(bar, #volume, 60) > 10000)
      then begin
         BuyAtMarket(bar+1, '');
         r := RSI(bar, #close, 14);
         a := ATRP(bar, 21);
         prio := Sqrt((Sqr(r)+Sqr(a))/2);
         SetPositionPriority(LastPosition, -prio);
   

原帖由 大泡泡 于 2008-5-18 15:03 发表 这是什么系统?看起来很不错。 是不是您说的POV + ADX?

[ 本帖最后由 biorjin 于 2008-5-18 15:41 编辑 ]
回复 鲜花 鸡蛋

使用道具 举报

发表于 2008-5-18 02:47 PM | 显示全部楼层

用的什么软件啊?看不懂程序。用白话解释一下吧。多谢。呵呵

 

原帖由 biorjin 于 2008-5-18 15:28 发表 No, it is very simple system based on SMA, RSI and ATRP. It was designed to "hit and run", so it is pretty good in a whipsaw market based on my backtest result. I have been using this to trade SP ...

for bar:=60 to BarCount-1 do begin
   if (PriceClose(bar) > PriceClose(bar-1)) and
      (PriceClose(bar-1) > PriceClose(bar-2))
   then begin
      SellAtMarket(bar+1, #all, '')
   end else begin
      if (PriceClose(bar) < PriceClose(bar-1)) and
         (PriceClose(bar-1) < PriceClose(bar-2)) and
         (SMA(bar, #volume, 60) > 10000)
      then begin
         BuyAtMarket(bar+1, '');
         r := RSI(bar, #close, 14);
         a := ATRP(bar, 21);
         prio := Sqrt((Sqr(r)+Sqr(a))/2);
         SetPositionPriority(LastPosition, -prio);

回复 鲜花 鸡蛋

使用道具 举报

发表于 2008-5-18 02:51 PM | 显示全部楼层
原帖由 biorjin 于 2008-5-18 15:28 发表 No, it is very simple system based on SMA, RSI and ATRP. It was designed to "hit and run", so it is pretty good in a whipsaw market based on my backtest result. I have been using this to trade SP ...


多谢。

要求红钻。
回复 鲜花 鸡蛋

使用道具 举报

发表于 2008-5-18 03:00 PM | 显示全部楼层
多谢~ 不过可以解释一下怎末用吗?
我不是学理的,不懂编程。
同要求红钻!
[ 本帖最后由 nstar 于 2008-5-18 16:02 编辑 ]
回复 鲜花 鸡蛋

使用道具 举报

发表于 2008-5-18 03:58 PM | 显示全部楼层
分享,先顶再看。
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2008-5-18 04:17 PM | 显示全部楼层

hehe, again it is a very simple one, you basically buy in dip (3 day in row) and sell on bounce (3 day in row) and you set the priority with average square root of ATRP and RSI.  I found it working on index (ETF) in a whipsaw market (what if the trend is obvious, easy, buy and hold or short to hell)

 

If you are interest about individual stocks, Try this one, more complicated, but winning percentage is pretty decent. You can run script at night. Further sort through results using tech. analysis. Support/Resistance etc. Go with your best candidates and Hit em and run the next day.

 

for Bar := 50 to BarCount - 1 do
begin
  if LastPositionActive then
  begin
    p := LastPosition;
    if CumUp( Bar, #Close, 1 ) >= 3 then
    begin
      SellAtMarket( Bar + 1, p, '' );
    end;
    TargetPrice := PositionEntryPrice( p ) * Target;
    SellAtLimit( Bar + 1, TargetPrice, p, 'Profit Target' );
  end
  else
  begin
    if not LastPositionActive then
    begin
      if PriceClose( Bar ) > EMA( Bar, #Close, 50) then
      begin
        if StochRSI( Bar, #Close, 14 ) > 60 then
        begin
          if GetSeriesValue( Bar, MEx ) > 0 then
          begin
            if TurnUp( Bar, MEx1 ) then
            begin
              if OBV( Bar ) > OBV( Bar - 20 ) then
              begin
                if DIPlus( Bar, 14 ) > DIMinus( Bar, 14 ) then
                begin
                  BuyAtMarket( Bar + 1, '4' );
 

profit.jpg

原帖由 nstar 于 2008-5-18 16:00 发表 多谢~ 不过可以解释一下怎末用吗?我不是学理的,不懂编程。 同要求红钻!

[ 本帖最后由 biorjin 于 2008-5-18 17:38 编辑 ]
回复 鲜花 鸡蛋

使用道具 举报

发表于 2008-5-18 05:36 PM | 显示全部楼层

回复 8# biorjin 的帖子

Is this written down in Fortran Language?
回复 鲜花 鸡蛋

使用道具 举报

发表于 2008-5-18 06:10 PM | 显示全部楼层

ding!

thanks for sharing!


[ 本帖最后由 xssl 于 2008-5-18 19:11 编辑 ]
回复 鲜花 鸡蛋

使用道具 举报

发表于 2008-5-18 08:56 PM | 显示全部楼层

Questions

1) (SMA(bar, #volume, 60) > 10000) - Means 60 day average volume >10000? How do you choose 10000? Which ETF? 2) SetPositionPriority(LastPosition, -prio); - what does this function mean? Many thanks!
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2008-5-19 12:55 AM | 显示全部楼层

Here is one of my favorite swing trade systems.

 

Three lines converge on 100, it signals a short; coverge on -100 strong buy.

 

It is based on IBSI and EMA. This signal is pretty sensitive and normally gives you a good timing. You have to put 5% stop loss on it for actual trading

 

isbi trend.jpg

 

Backtest on SP500, I believe one of big loss is on BSC . So 5% stop loss might not work in this case.

distribution.jpg

 

{$I 'NewMax'}

{#OptVar1 50;5;65;5}
{#OptVar2 30;5;65;5}
{#OptVar3 20;5;65;5}
{#OptVar4 20;5;65;5}

function IBSISeries( Series, Period: integer ): integer;
begin
  Result := MultiplySeriesValue(
            SumSeries( DivideSeries( SubtractSeries( Series, #Low ),
            SubtractSeries( #High, #Low ) ), Period ), 100/Period );
end;

const MA1 = #OptVar1;
const MA2 = #OptVar2;
const MA3 = #OptVar3;
const MA4 = #OptVar4;

 

var IBSISer,Bar: integer;
var Trend1, Trend2, Trend3, Trendpane: integer;
var Trendlow,Trendhigh,Tbar: integer;

Trend1 := EMASeries( #Close, MA1 );
Trend2 := EMASeries( #Close, MA2 );
Trend3 := EMASeries( #Close, MA3 );
IBSISer := IBSISeries( #Close, 5 );

Trendlow := NewMaxSeries( Trend3, MA4 );
TrendHigh := NewMaxSeries( Trend1, MA4 );
Tbar := NewMaxSeries( IBSISer, MA4 );
 
PlotSeriesLabel( Trend1, 0, 007, 1, 'EMA-'+IntToStr( MA1 ) );
PlotSeriesLabel( Trend2, 0, 060, 1, 'EMA-'+IntToStr( MA2 ) );
PlotSeriesLabel( Trend3, 0, 500, 1, 'EMA-'+IntToStr( MA3 ) );

TrendPane := CreatePane( 75, true, true );
PlotSeries( Trendlow,TrendPane , 900, 2 );
PlotSeries( Trendhigh, TrendPane, 050, 2 );
PlotSeries( Tbar, TrendPane, 009, 2 );
DrawLabel( 'ISBI Trend', TrendPane );

InstallProfitTarget( 2);

for Bar := 65*3 to BarCount() - 1 do
begin
     ApplyAutoStops( Bar );
      if (( Getseriesvalue(bar,Trendlow) = -100) and
          ( Getseriesvalue(bar,Trendhigh) = -100) and
          (  Getseriesvalue(bar,Tbar) = -100) ) then
             BuyAtMarket( Bar + 1, '0' );
end;

 

[ 本帖最后由 biorjin 于 2008-5-19 01:58 编辑 ]
回复 鲜花 鸡蛋

使用道具 举报

发表于 2008-5-19 01:02 AM | 显示全部楼层
惭愧。你们都上计算机了。我还在用算盘。
回复 鲜花 鸡蛋

使用道具 举报

发表于 2008-5-19 01:07 AM | 显示全部楼层

感谢BMW无私奉献!

 

蛇班长,请升级到红钻吧。

回复 鲜花 鸡蛋

使用道具 举报

发表于 2008-5-19 01:45 AM | 显示全部楼层
看起来挺像pascal (或delphi)的。什么trading软件还能用这种语言呢?
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2008-5-19 07:59 AM | 显示全部楼层

I used wealth lab developer. You can get free download from www.wealth-lab.com

 

 

原帖由 yager 于 2008-5-19 02:45 发表 看起来挺像pascal (或delphi)的。什么trading软件还能用这种语言呢?

回复 鲜花 鸡蛋

使用道具 举报

发表于 2008-5-19 01:57 PM | 显示全部楼层
原帖由 CoolMax 于 2008-5-19 02:07 发表 感谢BMW无私奉献! 蛇班长,请升级到红钻吧。


红钻是质和量的交集,现在主要是质,等NaturalLaw帖了更多好的内容在这个主题下面,就可以升级到红钻了。
回复 鲜花 鸡蛋

使用道具 举报

发表于 2008-5-19 02:05 PM | 显示全部楼层

胡同的人不但有趣的很,而且无私的很!!! 真是一个好风水的地方!!!

 

干脆精英们再发挥一下无私精神,教教我这个青蛙中的青蛙,如何理解你们那些曲线图,还有你们的专业炒股术语???

回复 鲜花 鸡蛋

使用道具 举报

发表于 2008-5-19 02:09 PM | 显示全部楼层
原帖由 天真的冷酷 于 2008-5-19 15:05 发表 胡同的人不但有趣的很,而且无私的很!!! 真是一个好风水的地方!!! 干脆精英们再发挥一下无私精神,教教我这个青蛙中的青蛙,如何理解你们那些曲线图,还有你们的专业炒股术语???


我也没看懂呢。 当这个系统有信号的时候,BMW可不可以给我们青蛙把信号贴出来啊?
回复 鲜花 鸡蛋

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|www.hutong9.net

GMT-5, 2024-9-26 06:33 PM , Processed in 0.053656 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表