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

[amibroker] Re: BuyPrice query



PureBytes Links

Trading Reference Links

Andrew,

I use a random price function that you may be able to modify to suit 
what your after:

//-------------------
function Randomize(a,b)
{
   result = Random()*(b-a)+a;
   return result;
}
//-------------------
//RANDOM OR DEFAULT 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 could possibly change the ( Low, High) in the above to the cross 
value plus the cross value * 1.2 or whatever and get a random value 
between the cross and some higher price.



--- In amibroker@xxxxxxxxxxxxxxx, Andrew Z <wizard@xxxx> wrote:
> G'day all,
> 
> For backtesting, is it possible to specify more than one price at 
which 
> you want a trade to be taken if that price is crossed during that 
bar???
> That is, am I able to have say 5 standing buy orders or only one at 
a time?
> 
> For example, can I have BuyPrice=1.5000 and 1.5010 and 1.5020 etc
at 
the 
> same time? Alternately, once I specify BuyPrice and a trade is 
entered 
> how then can I specify Buyprice + x??
> 
> Thanks,
> Andrew.




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