[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Fw: redundant signals



PureBytes Links

Trading Reference Links

try again ....
 
 
----- Original Message -----
Sent: Wednesday, July 11, 2007 8:28 PM
Subject: redundant signals

hi,
 
Tomasz provided new functionality to Amibroker in the latest beta: making use of redundant signals. It seems to work very good. Below I show example code how it can be used.
 
regards, Ed
 
 
 
If you leave the code like this:
 
//SetBacktestMode( backtestRegularRaw );
//SetBacktestMode( backtestRegularRawMulti );
it will run a backtest as usual without using the redundant signals.
 
If you set it as:
 
SetBacktestMode( backtestRegularRaw );
//SetBacktestMode( backtestRegularRawMulti );

then it will use the redundant signals but only take a position in 1 symbols at a time.
 
This setting
 
//SetBacktestMode( backtestRegularRaw );
SetBacktestMode( backtestRegularRawMulti );
can take multiple positions in 1 symbol at one time.
 
 
procedure sell_proc(Buy,imav,pds) {

global Sell
;
global SellPrice
;
Sell = 0
;
SellPrice = 0
;

for (i = pds; i < BarCount
; i++) {

   
if (Buy
[ i ]) {

      BuyAdjusted[ i ] =
1
;
      BuyPriceAdjusted[ i ] =
O
[ i ];
            
      
for (j = i + 1; j < BarCount
; j++) {
            

         
if (O
[ j ] > imav[ j ]) {
         
            
Sell[ j ] = 1
;
            
SellPrice[ j ] = O
[ j ];
            i = j;
            
break
;
            
         }
else if (O[ j ] < imav[ j ] AND H
[ j ] > imav[ j ]) {
         
            
Sell[ j ] = 1
;
            
SellPrice
[ j ] = imav[ j ];      
            i = j;
            
break
;   
                                       
         }
else if (j == BarCount - 1
) {
         
            i =
BarCount
;
         
         }            
         
      }

   }
   
}

}



SetBacktestMode
( backtestRegularRaw );
//SetBacktestMode( backtestRegularRawMulti );


SetBarsRequired(10000,10000);
SetOption("MaxOpenPositions", 100
);
PositionSize = -10
;
SetTradeDelays(0,0,0,0
);

pds =
10
;
PositionScore = Ref(50-StochK(pds),-1
);
mav =
MA(C
,pds);

Buy = StochK(pds) < 10
;
Buy = Ref(Buy,-1); BuyPrice = O
;

sell_proc(
Buy,Ref(mav,-1
),pds);

SetChartOptions(0, chartShowDates
);
GraphXSpace = 5
;
Plot(C,"C",1,64
);
Plot(Ref(MAv,-1),"",colorGold,styleThick
);

PlotShapes(IIf(Buy,shapeSmallUpTriangle,0),colorWhite, layer = 0, yposition = BuyPrice, offset = 0
);
PlotShapes(IIf(Sell,shapeDownArrow,0),colorYellow, layer = 0, yposition = SellPrice, offset = 0 );
__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___