• Australian (ASX) Stock Market Forum

Hello and welcome to Aussie Stock Forums!

To gain full access you must register. Registration is free and takes only a few seconds to complete.

Already a member? Log in here.

Amibroker: What is this doing?

Discussion in 'Trading Strategies/Systems' started by Steve C144, Aug 5, 2019.

sentifi.com

Aussie Stock Forum Sentifi Top themes and market attention on:

Tags:
  1. Steve C144

    Steve C144

    Posts:
    19
    Likes Received:
    0
    Joined:
    Jun 17, 2019
    Hello all,
    I hope I have posted this in the right place....

    Ref(sp500,-1)-sp500 < 10;

    The above line of code in Amibroker is supposed to evaluate the close of the S&P500 yesterday against today and see if it is less than 10 points. My question is: how does the code know to use the close price? Or is that the default? SP500 is my array for the S&P500 index. How do I include that the close is used or is that assumed??
    THanks in advance.
     
  2. DaveDaGr8

    DaveDaGr8

    Posts:
    105
    Likes Received:
    21
    Joined:
    Jun 29, 2007
    You should probably do something like this.

    sp500 = Foreign("$SPX", "Close", 1);

    BEFORE you do this

    Ref(sp500,-1)-sp500 < 10;
     
    qldfrog likes this.
  3. Steve C144

    Steve C144

    Posts:
    19
    Likes Received:
    0
    Joined:
    Jun 17, 2019
    Of course...obvious once you point it out...cheers
     
Loading...

Share This Page