Announcement

Collapse
No announcement yet.

adx efs

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

  • adx efs

    I've tried various permutations of the new adx function without any luck. Tried in es #f 3000v and 750v charts:

    function preMain()
    {
    setStudyTitle("ADXMoSet");
    setCursorLabelName("ADXMoSet",0);
    setPlotType(PLOTTYPE_HISTOGRAM, 0);
    }

    var vADX = null;

    function main()
    {
    if (vADX == null)
    {
    //vADX = adx(7, 3, close(sym("ES #F, 3000v")));//new ADXDMStudy(7, 3);
    vADX = adx(7, 3, close(inv("3000v")));
    return 0;
    }

    var adx = vADX.getValue(0); //vADX.getValue(ADXDMStudy.ADX);
    if (adx == null)
    return -1;
    return adx;

    }

    Also tried using '1' instead of '3000v'.

    My return is always <none>.

    Thanks.

  • #2
    cashcarewins
    You named the variable adx using a function name.
    Try replacing all instances of the variable adx with xadx (or other name) and you will see it works
    Alex

    Comment


    • #3
      Thanks, my bad (although an error msg would have been good).

      When I put this on the 750v chart, the first bar in a sequence of 4 (4 x 750v bars = 1 x 3000v) has the correct "setBarFgColor(prevcolor = Color.green,0)". However, the next 3 are blue if positive of purple if negative. Is there some way to override this and keep all 4 bars the same color?

      Comment


      • #4
        cashcarewins
        Post the code or a working example and someone may be able to help
        Alex

        Comment

        Working...
        X