Including SPY trend in back test script

Optuma Forums Optuma Scripting Including SPY trend in back test script

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #58747
    AvatarKim
    • Topics: 11
    • Replies: 9
    • Posts: 20

    Hi,

    Is there a way to include the market trend in a back test script? I know the following doesn’t work, but I’m looking for something like:

    v1 = MA(SPY:US) IsUp

    or

    v1 = MA(SPY:US, 10 day) > MA(SPY:US, 20 day)

    Thanks

    Kim

    #58773
    DarrenDarren
    • Topics: 53
    • Replies: 428
    • Posts: 481

    Hi Kim,

    You can use the GETDATA function to reference another symbol, eg:

    V1 = GETDATA(CODE=SPY:US);
    V1 > MA(V1, BARS=20, CALC=Close)

    https://help.optuma.com/kb/faq.php?id=1057

    1 user thanked author for this post.
    Avatar Kim
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close