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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      35 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      12 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      18 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      20 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X