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

[amibroker] Resetting trade delays based on value of variable



PureBytes Links

Trading Reference Links

Just wondering if this is even possible. I checked the AFL help files,
searched the online AFL Formula reference and also searched this yahoo
group. Every example only shows the SetTradDelays() function being
used one time in the code and never 'adjusted' to some other value
based on a condition. I created this function which seems to me should
work correctly but I have no way to really be sure it's working as
designed. I am using the printf() function several times to keep track
of different values during bar replay, (thanks to Razzbarry), but I
can't find a way to print the values of the trade delays to the output
window. 
//[code]*************************************************
SetTradeDelays(0,0,0,0);
BuyPrice = Open;
SellPrice = Open;

Buy = <<insert buy rule here>>
fltr = <<some test value to see of delays should be adjusted>>
function dly()
{
	if (fltr == 1)
	SetTradeDelays(0,0,1,1);
	else
	SetTradeDelays(0,0,0,0);
}
sell = <<insert sell rule here>>
//[/code]************************************************

The goal here is to change the trade delays to 0,0,1,1 only if the
fltr variable returns a true value of 1.
Thanks for taking the time to check this out.

  Pete  :-)


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

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/