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

Re: [amibroker] Buy. False/True?



PureBytes Links

Trading Reference Links

Actually a little longer (12 days?) But thanks for your reply. The way to  
solve the issue is to use the backtester in a lower level programing.
Jerry

On Wed, 01 Nov 2006 10:03:44 -0500, Terry <MagicTH@xxxxxxxxxxx> wrote:

> 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=Cross( C, MA(C,20 ) ); should be true when the cross
> occurs. Right!
>
>
> 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-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
> Behalf Of laster
> Sent: Tuesday, October 10, 2006 21:21
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Buy. False/True?
>
>
> 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=Cross( C, MA(C,20 ) ); should be true when the cross
> occurs. Right? Wrong?
>
>
> I am trying:
>
> Reason2= Cross( C, MA(C,20 ) );
>
> 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. :-(
>
>
> 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
>
>
>
>



-- 
Kind regards,
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
 
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/
 


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.27/517 - Release Date: 11/3/2006