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

[amibroker] Re: using BuyPrice in real trading



PureBytes Links

Trading Reference Links

Eric,

I use the below code which gives a random price between the high and 
low for backtesting:

//--------------------------
//Random Buy & Sell Price
Randm       = ParamToggle("Random (Market Order)","Off|On");
if (Randm==1)
{
   BuyPrice  = Randomize( Low,High) ; // Random buy
   SellPrice = Randomize( Low,High);  // Random sell
   PositionScore = Random();
}
else
   BuyPrice  = Open;
   SellPrice = Open;
//--------------------------

You can turn it off and then it uses the Open for the buy and sell 
price. You could backtest both to see how the system results change.

You could also add to the above code a worst case ie:

   BuyPrice  = High;
   SellPrice = Low;

...if trading long!

Cheers, Glenn




--- In amibroker@xxxxxxxxxxxxxxx, eric paradis 
<thechemistrybetweenus@xxxx> wrote:
>
> I backtested using the following code and my return
> went up significantly. Is it likely that I would get
> filled with this strategy? Does Amibroker provide an
> adequate testing for these types of orders?
> 
> BuyPrice = Close - (.5 *(High-Low));
> 
> Thanks,
> 
> Eric





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/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/