Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Variable Moving Average (VMA) by Chande?

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

    Variable Moving Average (VMA) by Chande?

    Hello , couldnīt find the original VMA indicator by Chande.
    I know in NT8 there is a so called "VMA" indicator but which seems to be the VIDYA by Chande.
    I donīt mean the ViDYA indicator which is often mistaken for the VMA.
    Someone programmed the VMA for tradingview and Tos which isnīt original in their systems.
    Is there a way to implement it here?


    Thanks

    #2
    Hello Antares66,

    If you have the code or equation for what you want in another platform you can likely transition that over to NinjaScript. There is not a specific conversion process in that case however very often the different trading platforms have very similar code that can be used in similar ways.

    The NT8 VMA can be duplicated so you could use that as a starting point if the equation you want is not far off from that. To make a duplicate you can open the original script in the NinjaScript editor and then Right click -> Save AS.



    I look forward to being of further assistance.

    Comment


      #3
      Hi guys.

      I do have it's code from another plataform, but I don't know how to use NinjaScript yet. In any case, that's the code and if someone manages to have it on NinjaScript, please, send it over.

      input
      src(close);
      l(6);

      var
      k:float;
      pdm:float;
      x:float;
      y:float;
      mdm:float;
      pdms:float;
      mdms:float;
      s:float;
      pdi:float;
      mdi:float;
      pdis:float;
      mdis:float;
      d:float;
      s1:float;
      is:float;
      hhv:float;
      llv:float;
      d1:float;
      vi:float;
      vma:float;
      begin
      k := 1.0/l;
      x := (src - src[1]);
      y := (src[1] - src);

      if x > 0 then
      pdm := x
      else if x <= 0 then
      pdm := 0;

      if y > 0 then
      mdm := y
      else if y <= 0 then
      mdm := 0;

      pdmS := ((1 - k)*(pdmS[1]) + k*pdm);
      mdmS := ((1 - k)*(mdmS[1]) + k*mdm);
      s := pdmS + mdmS;
      pdi := pdmS/s;
      mdi := mdmS/s;
      pdiS := ((1 - k)*(pdiS[1]) + k*pdi);
      mdiS := ((1 - k)*(mdiS[1]) + k*mdi);
      d := abs(pdiS - mdiS);
      s1 := pdiS + mdiS;
      iS := ((1 - k)*(iS[1]) + k*d/s1);
      hhv := highest(iS, l);
      llv := lowest(iS, l);
      d1 := hhv - llv;
      vI := (iS - llv)/d1;
      vma := (1 - k*vI)*(vma[1]) + k*vI*src;

      if vma = vma[1] then
      setplotcolor(1,clbranco);
      if vma > vma[1] then
      setplotcolor(1,cllime);
      if vma < vma[1] then
      setplotcolor(1,clred);

      plot(vma);

      end

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      647 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      573 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X