• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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.
        Patrick H.NinjaTrader Customer Service

        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.
          Patrick H.NinjaTrader Customer Service

          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.
              Patrick H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by RobertoPaez, Today, 06:47 PM
              0 responses
              1 view
              0 likes
              Last Post RobertoPaez  
              Started by catinabag, Today, 06:45 PM
              0 responses
              1 view
              0 likes
              Last Post catinabag  
              Started by darkgreen, Today, 03:35 PM
              0 responses
              7 views
              0 likes
              Last Post darkgreen  
              Started by GTBrooks, Today, 02:44 PM
              3 responses
              14 views
              0 likes
              Last Post GTBrooks  
              Started by GLFX005, Today, 12:22 PM
              4 responses
              41 views
              0 likes
              Last Post NinjaTrader_Kate  
              Working...
              X