|
It's 12 hours later, but I don't see an answer to your question so,
You need to review the documentation for Backtesting Systems. Some points to consider: Buy DOES return True or False. Buy also triggers the backtester to run. BuyPrice is the price at which you Buy, which is normally the Open or the Close of the same or the next bar. There is also Sell, SellPrice, Short, ShortPrice, Cover, CoverPrice Also look up SetTradeDelays().
For instance, Buy
Reason2 will never be Null. The way you wrote it, it will be 1 (True) or 0 (False). (Well, it will be Null for the first 20 bars since the 20 day MA cross is invalid until at least 20 days have gone by.)
You cannot set Buy = C; You can set BuyPrice = C; Remember, both of the above are ARRAYS. That is, they set ALL BARS at the SAME TIME. -- Terry -----Original Message-----
I was hoping the function Buy to return a False/True that I could use in an if or while statement. I can’t figure it out how to access it. For instance, Buy
I am trying: Reason2= IIf(IsNull( Reason2), 0, Buy=C); Expecting a null value whenever there is no cross, but it does not work.
Same results with IsEmpty and istrue. If I try to access it with If, I don’t know which part of the array to call. L
Is there a way to look into the array Reason2 for debugging purposes? I guess I should move the code to a dll and call it from AFL. Thanks in advance for any thoughts. Jerry
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
SPONSORED LINKS
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___ |
- RE: [amibroker] Buy. False/True? Terry
- Re: [amibroker] Buy. False/True? Jerry Laster
