Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Getting the color of the Azors bar?

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

    Getting the color of the Azors bar?

    How do I get the color of the current (or last) Azors bar, if it's red or green. I've been trying values as:

    Azors(5,24,21,55).BarColor
    Azors(5,24,21,55).PlotColors[1]
    Azors(5,24,21,55).Plots[1]

    without luck. I just want to know if the Azors value, is Color.Green or Color.Red Thanks
    Attached Files

    #2
    Hello timmbbo,

    Thank you for your note.

    I have attached a screen shot for how you could print the color of a plot.

    Code:
    Print(SMA(Fast).Plots[0].Pen.Color.ToString());
    I modified the sample ma cross preloaded on Ninjatrader and added the following,

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thanks. that's helpful. However, I'm running into a problem that the value never switches - it's always Green. The code is:

      Print("The Azor color is " + Azors(5,24,21,55).Plots[0].Pen.Color.ToString() + ", at time " + Time[0]);

      The only value printed is "Green", no matter if the line is drawn as Green, or Red. Your thoughts? Thanks,
      Attached Files
      Last edited by timmbbo; 02-10-2018, 09:24 PM.

      Comment


        #4
        Hello timmbbo,

        Thank you for your response.

        Is Azors your own code or a third party's?

        Do you know if it uses multiple plot objects?

        If this is your code can you send it to us to test on our end?

        You can export your indicator by going to Tools > Export > NinjaScript Add On > Add > select your indicator > OK > Export > name the file 'NTsupport' > Save.
        The file will be located under Documents\NinjaTrader 8\bin\Custom\ExportNinjaScript. Please attach the file to your response.

        Please send the file to platformsupport[at]ninjatrader[dot]com with 'ATTN: Patrick H' in the subject line and reference this thread in the body of the email.

        I look forward to your response.

        Comment


          #5
          Hello timmbbo,

          Thank you for your patience.

          I overlooked this fact but the code below only pulls the initial color.
          Code:
          Azors(5,24,21,55).Plots[0].Pen.Color
          If you want to find out if the color changed you need to pull the same condition or configure the Azors indicator to output another value, plot, or public series that indicates whether it is red or green. Essentially, there is no means to pull the current color of the plot from another indicator or strategy.

          Please let me know if you have any questions.

          Comment


            #6
            Patrick, thanks for your help. This will be new code for me, so could you point me to a code example that demonstrates how to construct a public data series, and then pass that value? Thanks,

            Comment


              #7
              Hello timmbo,

              Thank you for your response.

              We do have a reference sample on exposing Series as public for access in another script available at the following link: https://ninjatrader.com/support/foru...ead.php?t=4991

              Please let me know if you have any questions.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by gemify, 11-11-2022, 11:52 AM
              6 responses
              803 views
              2 likes
              Last Post ultls
              by ultls
               
              Started by ScottWalsh, Today, 04:52 PM
              0 responses
              3 views
              0 likes
              Last Post ScottWalsh  
              Started by ScottWalsh, Today, 04:29 PM
              0 responses
              7 views
              0 likes
              Last Post ScottWalsh  
              Started by rtwave, 04-12-2024, 09:30 AM
              2 responses
              22 views
              0 likes
              Last Post rtwave
              by rtwave
               
              Started by tsantospinto, 04-12-2024, 07:04 PM
              5 responses
              70 views
              0 likes
              Last Post tsantospinto  
              Working...
              X