Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

VWAP - up/down color change

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

    VWAP - up/down color change

    I use the following indicator code on my tradestation 233 tick chart.
    [LegacyColorValue = true];
    { VWAP MA }
    input:
    Price(AvgPrice),length(25),upColor(cyan),dnColor(r ed);
    vars:
    it(0);
    it = VWAP_SMA(Price,length);
    plot1(it,"VWAP MA");
    if plot1 > plot1[1] then setplotcolor(1,upColor);
    if plot1 < plot1[1] then setplotcolor(1,dnColor);

    Can someone tell me how to code this in Ninja?

    #2
    toddaclark,

    For color changes please see this: http://www.ninjatrader-support2.com/...ead.php?t=3227
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh,

      Thanks for your reply. I downloaded the indicator that you mentioned in your post.

      That indicator seems to use SMA. How can I change it to be VWMA instead of SMA?

      Also, how do I get the candles above VWAP to paint blue and the candles below VWAP to paint red?

      Comment


        #4
        toddaclark,

        The link I referred you to is a reference sample. You can make changes you want to it however you see fit. If you don't want to use SMA just replace it with whatever you do want to use.

        You will need to program yourself an indicator that checks the VWAP and then colors the candles. To color the candles you want to use BarColor.

        if (some condition)
        BarColor = Color.Red;
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          take a look at the MACDUpDown code to see how to color it


          Originally posted by toddaclark View Post
          I use the following indicator code on my tradestation 233 tick chart.
          [LegacyColorValue = true];
          { VWAP MA }
          input:
          Price(AvgPrice),length(25),upColor(cyan),dnColor(r ed);
          vars:
          it(0);
          it = VWAP_SMA(Price,length);
          plot1(it,"VWAP MA");
          if plot1 > plot1[1] then setplotcolor(1,upColor);
          if plot1 < plot1[1] then setplotcolor(1,dnColor);

          Can someone tell me how to code this in Ninja?

          Comment


            #6
            another idea would be to set some public boolean properties within VWAP (you'd have to recode VWAP to do this) ... and then you could load up a VWAP in your indicator and do what Josh said to color the candles accordingly by accessing those properties

            eg. in your new indicator:
            Code:
            if (myVWAP.IsSomething == true) { BarColor = Color.Red; }
            elseif (myVWAP.IsSomethingElse == true) { BarColor = Color.Green; }

            Comment


              #7
              Thanks for everyone's comments!

              Much appreciated!

              Comment

              Latest Posts

              Collapse

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