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

Re: [amibroker] Re: please help with this stupid simple code,



PureBytes Links

Trading Reference Links

Check you have the filter in AA window set for the right periods/dates.
You can simplify this

GainedTen = IIf( ( High - Open ) >= 10, 1, 0 );
SellPrice = IIf( GainedTen, Open + 10, Close );

to
SellPrice = IIf( (H-O) >= 10, Open + 10, Close );

you will probably need to have your trade delays set to zero in the AA
settings or in AFL by
SetTradeDelays(0,0,0,0);

Also I am not certain how AB reacts for buy and sell on same bar.
Check the help files, and for some discussions in this group.

On 6/10/05, flintstone007fred <fred-dragon@xxxxxx> wrote:
> Many thanks for the code.
> 
> I tested it and it works fine, but only 79 rows (therefore 79 days)
> are backtested. Just 79 of approx. 500.
> 
> What could that be ?
> 
> Thanks
> 
> Fred
> 
> 
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Steve Dugas" <sjdugas@xxxx> wrote:
> > Hi,
> >
> > I have not tested it but I think something like this should work:
> >
> > Steve
> > --------------------------------------------------
> > Buy = 1;
> > Sell = 1;
> > BuyPrice = Open;
> > GainedTen = IIf( ( High - Open ) >= 10, 1, 0 );
> > SellPrice = IIf( GainedTen, Open + 10, Close );
> >
> >
> > ----- Original Message -----
> > From: "flintstone007fred" <fred-dragon@xxxx>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Thursday, June 09, 2005 6:21 AM
> > Subject: [amibroker] please help with this stupid simple code,
> >
> >
> > > Good morning,
> > >
> > > I want to start learning AFL with this simple stupid code, but I am
> > > not getting further.
> > >
> > > Buy=Open;
> > > conditionsell=IIf ((H-O)>10,SellPrice=(Open+10),SellPrice=Close);
> > > Sell=Conditionsell;
> > >
> > > this should just buy at the opening and sell if the Dow Jones is going
> > > up 10 Points. The profit should be 10 Points.
> > > If the Dow is not going up 10 points the position should be closed at
> > > the end of the day.
> > >
> > > The backtest with this code is giving me daily results with just a buy
> > > at the opening and sell at the close.
> > >
> > > What is wrong ? pls help ?
> > >
> > >
> > >
> > >
> > >
> > >
> > > 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 other support material please check also:
> > > http://www.amibroker.com/support.html
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> 
> 
> 
> 
> 
> 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 other support material please check also:
> http://www.amibroker.com/support.html
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 


-- 
Cheers
Graham
http://e-wire.net.au/~eb_kavan/


------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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 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/

<*> 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/