Announcement

Collapse
No announcement yet.

Undefined Value

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Undefined Value

    I am trying to create a new study that tracks the spike highs.

    As follows:

    if( (high(-2) > high(-1) && high(-2) > high(-3)) ){
    var aSpikeHi = high(-2);
    }

    But my results return:

    SpikeHi undefined
    SpikeHi undefined
    SpikeHi undefined
    SpikeHi undefined
    SpikeHi 1318

    How do I get the results to look like this:

    SpikeHi 1318
    SpikeHi 1318
    SpikeHi 1318
    SpikeHi 1318
    SpikeHi 1318


    Any help would be great.

    Thanks
    Aengus
    Attached Files

  • #2
    Re: Undefined Value

    Aengus
    Remove the var in line 12 of your script.
    Alex


    Originally posted by amclister
    I am trying to create a new study that tracks the spike highs.

    As follows:

    if( (high(-2) > high(-1) && high(-2) > high(-3)) ){
    var aSpikeHi = high(-2);
    }

    But my results return:

    SpikeHi undefined
    SpikeHi undefined
    SpikeHi undefined
    SpikeHi undefined
    SpikeHi 1318

    How do I get the results to look like this:

    SpikeHi 1318
    SpikeHi 1318
    SpikeHi 1318
    SpikeHi 1318
    SpikeHi 1318


    Any help would be great.

    Thanks
    Aengus

    Comment


    • #3
      Alex,

      Thats perfect, thanks.

      Aengus

      Comment


      • #4
        Aengus
        My pleasure
        Alex


        Originally posted by amclister
        Alex,

        Thats perfect, thanks.

        Aengus

        Comment

        Working...
        X