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

[amibroker] Re: Backtesting (Commisions)



PureBytes Links

Trading Reference Links

Hi there,

i have this system:

stopamount = Optimize("stopLoss", 10, 10, 100, 2);
profitamount = Optimize("stopProfit", 10, 10, 100, 2);
ApplyStop( stopTypeLoss, stopModePoint, stopamount, 1);
ApplyStop( stopTypeProfit, stopModePoint, profitamount, 1);

entrySignal = Cross(MACD(fast,slow),Signal(fast,slow));

Short = entrySignal;
Cover = 0;

the only why out from this system its by stoploss/stopprofit
but i want to add the spreads.. i know i must use:

SellPrice = SellPrice - spreads

but how can i integrate this in my formula..

Thank you,
GV


--- In amibroker@xxxxxxxxxxxxxxx, "ifrmd" <ifrmd@xxx> wrote:
>
> --- In amibroker@xxxxxxxxxxxxxxx, Grant Noble <gruntus@> wrote:
> >
> > Was wondering if I'd ever use switch. Now I can! Thanks Tomasz.
> > 
> > Tomasz Janeczko wrote:
> > > Hello,
> > > 
> > > Yes, but for the moment you can easily code this that way:
> > > 
> > > n = Name();
> > > 
> > > spread = 0;
> > > 
> > > switch( n )
> > > {
> > >   case "EURUSD": spread = 2; break;
> > >   case "USDPLN": spread = 30; break;
> > >   default:  spread = 3; break;
> > > }
> > >  
> > > BuyPrice = BuyPrice + spread;
> > > 
> > > Best regards,
> > > Tomasz Janeczko
> > > amibroker.com
> > > ----- Original Message ----- 
> > > From: "Grant Noble" <gruntus@>
> > > To: <amibroker@xxxxxxxxxxxxxxx>
> > > Sent: Monday, October 29, 2007 11:10 PM
> > > Subject: Re: [amibroker] Backtesting (Commisions)
> > > 
> > > 
> > >> Of course it would be ideal to specify spread on a per symbol 
> basis as dealing spread typically 
> > >> varies with different pairs. Here's my FC request of some time 
> ago:
> > >> http://www.amibroker.com/feedback/view_bug.php?bug_id=447
> > >>
> > >> Tomasz Janeczko wrote:
> > >>> BuyPrice = BuyPrice + 0.0005; // add spread
> > >>>
> > >>> Best regards,
> > >>> Tomasz Janeczko
> > >>> amibroker.com
> > >>> ----- Original Message ----- 
> > >>> From: "ifrmd" <ifrmd@>
> > >>> To: <amibroker@xxxxxxxxxxxxxxx>
> > >>> Sent: Sunday, October 28, 2007 8:48 PM
> > >>> Subject: [amibroker] Backtesting (Commisions)
> > >>>
> > >>>
> > >>>> Hi! I got an a backtesting problem. I'm trying to backtest my 
> system 
> > >>>> on forex currency pairs. My broker asks for 5 point commision 
> for 
> > >>>> every position i open. How do i set settings in Amibroker to 
> get 
> > >>>> correct results. Without those setting my backtesting dont 
> have any 
> > >>>> sence. Please, 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 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
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>
> > >>> 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
> > >>>
> > >>>
> > >>>
> > >>>
> > >>
> > >> 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
> > >>
> > >>
> > >>
> > >>
> > >>
> > > 
> > > 
> > > 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
> > > 
> > > 
> > > 
> > >
> >
> 
> And if i need to count all spread paid (for Bactesting Period)?
>




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

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL 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/