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

[amibroker] Re: my trades



PureBytes Links

Trading Reference Links

Each line must have a unique Study ID. For example; "01", "02", "03".
Then modify your program to recognize all three values.

SetTradeDelays( 0, 0, 0, 0 ); // buydelay, selldelay,shortdelay, 
coverdelay
 
Risiko = -0.25 ; //risiko auf das depot
RisikoimWert = Ref (H,-1) - Ref (L,-1) ; // risiko im wert
PositionSize = ( Risiko / RisikoimWert) * BuyPrice;
 
Buy = Cross (H, Study( "01",1000) ) || Cross (H, Study( "02",1000) ) 
|| Cross (H, Study( "03",1000) );
BuyPrice= Ref (H,-1);
 
Sell = L < Ref (L,-1);
//Sellstop = Ref (L,-1);
SellPrice = Min ( Open, Ref (L,-1));
 
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);

Mike
 
--- In amibroker@xxxxxxxxxxxxxxx, "kmunnecke" <kmunnecke@xxx> wrote:
>
> i have only one open trade at time.
> a sampel,
>  
> i draw 3 lines in AAPL
> at first,
> 14.4 - 15.4.2008  149.30$
> then a long line
> 3.12 - 20.12.2007  184,84$
> 3)
> 9.5 - 12.5.2008  184.71
>  
> all "Study UP"
>  
> my programm
> SetTradeDelays( 0, 0, 0, 0 ); // buydelay, selldelay,shortdelay,
> coverdelay
> 
> Risiko = -0.25 ; //risiko auf das depot
> 
> RisikoimWert = Ref (H,-1) - Ref (L,-1) ; // risiko im wert
> 
> PositionSize = ( Risiko / RisikoimWert) * BuyPrice;
> 
> Buy = Cross (H, Study( "UP",1000) );
> 
> BuyPrice= Ref (H,-1);
> 
> Sell = L < Ref (L,-1);
> 
> //Sellstop = Ref (L,-1);
> 
> SellPrice = Min ( Open, Ref (L,-1));
> 
> Buy = ExRem(Buy,Sell);
> 
> Sell = ExRem(Sell,Buy);
> 
> now the backtest,
> 
> at first AB Buy 15.4 and sell 22.4
> 
> none other signals?
> 
> now i delet the line there i draw at first,
> 
> backtest,
> 
> AB buys 5.12  sell 11.12.2007 and buy 20.12 sell 28.12.2007
> 
> it is correctly, but the last line signals not works?
> 
> i delet the long line
> 
> AB buy 12.5 and sell 14.5.2008.
> 
>  
> 
> AB looks only too the line i draw first, why?
> 
> it is a simpeles program ,
> can you test it of your PC?
>  
> thanks
> Klaus
> 
> 
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@> wrote:
> >
> > You can only have one open trade at a time for each stock.
> > If you want to have more than one trade open at the same time, 
you 
> > have two choices:
> > 
> > 1) Set Buy to SigScaleIn
> > http://www.amibroker.com/guide/h_pyramid.html
> > 
> > 2) Write custom backtest and use SetBacktestMode
> > (backtestRegularRawMulti);
> > http://www.amibroker.com/guide/afl/setbacktestmode.html
> > 
> > Mike
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "kmunnecke" <kmunnecke@> wrote:
> > >
> > > 	
> > > I think a picture says more than one thousand words
> > > 
> > > i have 15 trades.
> > > http://img233.imageshack.us/my.php?image=21arc2.gif
> > > 
> > > now i look the trades in AB.
> > > i draw a line at my buy date.
> > > 
> > > http://img61.imageshack.us/my.php?image=studyjq6.gif
> > > http://img61.imageshack.us/my.php?image=study1gj5.gif
> > > 
> > > there are now 14 trades,
> > > i buy CSCO 7.5 and 12.5
> > > AB buy CSCO only 7.5
> > > 
> > > 
> > > --- In amibroker@xxxxxxxxxxxxxxx, "kmunnecke" <kmunnecke@> 
wrote:
> > > >
> > > > Thank you,
> > > > but I think this is not my problem.
> > > > I buy one worth (Shares) 3 times.
> > > > at first my stop if the low yesterday,
> > > > now i  look a stop 1 ATR.
> > > > the buy time is the same.
> > > >  
> > > > 3 buys in one shares,
> > > > then i look different stops
> > > >  
> > > > i dont look to the different lines,
> > > > the buy time is reality.
> > > >  
> > > > i looks for the best stop of my entrys.
> > > > but AB buys only the first line in the chart and i buys 2 or 
5.
> > > > 
> > > > 
> > > > 
> > > > --- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@> wrote:
> > > > >
> > > > > Use Study ID "01", "02", "03", etc.
> > > > > Use Optimization to see results from different lines.
> > > > > 
> > > > > Mike
> > > > > 
> > > > > 
> > > > > Risiko = -0.25 ; //risiko auf das depot
> > > > > 
> > > > > RisikoimWert = Ref (H,-1) - Ref (L,-1) ; // risiko im wert
> > > > > 
> > > > > PositionSize = ( Risiko / RisikoimWert) * BuyPrice;
> > > > > 
> > > > > StudyID = Optimize("Study ID", 1, 1, 3, 1);
> > > > > Buy = Cross (H, Study(StrFormat("%02.0f", StudyID), 1000));
> > > > > 
> > > > > BuyPrice= Ref (H,-1);
> > > > > 
> > > > > Sell = L < Ref (L,-1);
> > > > > 
> > > > > //Sellstop = Ref (L,-1);
> > > > > 
> > > > > SellPrice = Min ( Open, Ref (L,-1));
> > > > > 
> > > > > Buy = ExRem(Buy,Sell);
> > > > > 
> > > > > Sell = ExRem(Sell,Buy);
> > > > > 
> > > > > --- In amibroker@xxxxxxxxxxxxxxx, "kmunnecke" <kmunnecke@> 
> > wrote:
> > > > > >
> > > > > > I draw a line "Study UP"
> > > > > > do backtest and AB buy correctly
> > > > > >  
> > > > > > I draw a second line "Study UP"
> > > > > > do backtest and AB buy just the first line?
> > > > > >  
> > > > > > i Delete the first line, AB buy the second line?
> > > > > >  
> > > > > > AB works always with the line i draw first?
> > > > > > but I would like to work with multiple lines,
> > > > > > there are my trades and i look for different stopps.
> > > > > > SetTradeDelays( 0, 0, 0, 0 ); // buydelay, 
> > selldelay,shortdelay,
> > > > > > coverdelay
> > > > > > 
> > > > > > Risiko = -0.25 ; //risiko auf das depot
> > > > > > 
> > > > > > RisikoimWert = Ref (H,-1) - Ref (L,-1) ; // risiko im wert
> > > > > > 
> > > > > > PositionSize = ( Risiko / RisikoimWert) * BuyPrice;
> > > > > > 
> > > > > > Buy = Cross (H, Study( "UP",1000) );
> > > > > > 
> > > > > > BuyPrice= Ref (H,-1);
> > > > > > 
> > > > > > Sell = L < Ref (L,-1);
> > > > > > 
> > > > > > //Sellstop = Ref (L,-1);
> > > > > > 
> > > > > > SellPrice = Min ( Open, Ref (L,-1));
> > > > > > 
> > > > > > Buy = ExRem(Buy,Sell);
> > > > > > 
> > > > > > Sell = ExRem(Sell,Buy);
> > > > > >
> > > > >
> > > >
> > >
> >
>



------------------------------------

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
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/