Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Doji bars with NT

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

    Doji bars with NT

    i have a question about NT charting.

    doji bars are always drawn in the color of green. is there any possibility to change the color of that doji bars anyway?

    regards,

    RM

    #2
    Just need to code an indicator

    You could code an indicator, something like this and apply it to the chart:

    #region Variables
    private Color smallBody = Color.Black;
    #endregion

    protected override void Initialize()
    {
    CalculateOnBarClose =
    false;
    Overlay =
    true;
    PriceTypeSupported =
    false;
    DisplayInDataBox =
    false;
    PaintPriceMarkers =
    false;
    }

    protected override void OnBarUpdate()
    {
    if (Math.Abs(Close[0]-Open[0])< 0.25*ATR(14)[0]) // Small body bar
    BarColor = smallBody;
    }

    #region Properties
    ///
    <summary>
    ///</summary>
    [Description("Select Bar Color")]
    [Category(
    "Colors")]
    [Gui.Design.DisplayName(
    "Doji")]
    public Color SmallBody
    {
    get { return smallBody; }
    set { smallBody = value; }
    }
    // Serialize Color object
    [Browsable(false)]
    public string SmallBodySerialize
    {
    get { return NinjaTrader.Gui.Design.SerializableColor.ToString( smallBody); }
    set { smallBody = NinjaTrader.Gui.Design.SerializableColor.FromStrin g(value); }
    }
    #endregion

    Comment


      #3
      code couldn't be compiled by NT

      thanks for your response, but NT isn't able to compile the code you've posted. please note: i'm neewb with coding and NT scripting as well.

      Comment


        #4
        eDanny
        NinjaTrader Ecosystem Vendor - Integrity Traders

        Comment


          #5
          Here's the indicator, quick and dirty. Just import via NT. You might want to enhance it.

          Originally posted by Risk Manager View Post
          thanks for your response, but NT isn't able to compile the code you've posted. please note: i'm neewb with coding and NT scripting as well.
          Note: original file posted here removed because it had a bug, please use other file posted
          Last edited by Harry; 02-25-2010, 09:39 AM.

          Comment


            #6
            can't import scripts

            hi,
            i get the following message when i try to import NT scripts:

            you have custom NT script files on your pc that have programming errors...

            Comment


              #7
              The error indicates your current NinjaScript files contain errors, which need to resolved first before you can import new NinjaScript files.

              Please follow the instructions below to see where the errors are coming from after compiling any indicator or strategy. This will allow you to debug the indicator/ strategy or remove it from your PC. If you’re wondering why you receive an error when compiling only one indicator or strategy, it is because NinjaTrader compiles all indicators and strategies. Not just one.

              1) Open NinjaTrader
              2) From the Control Center -> Tools -> Edit NinjaScript -> Indicator
              3) Select an indicator and double click on it.
              4) A new window will appear and you will need to right click and compile the indicator.
              5) At the bottom of the window a new section will appear were you can find the error locations. Double click the error and you will be directed to the location of the error.
              6) From there you have the option to remove the indicator or debug it. You can delete NinjaScript files via Tools-->Edit NinjaScript-->Indicator/Strategy, highlight it and select Delete

              You can find general debug information at the link below.


              In addition, you can try the following workaround as well. Note that you will lose all custom and third party NinjaScript files.

              Create a backup file with 'NinjaScript files' unchecked(!).


              Uninstall NinjaTrader via the Windows Control Panel-->Add/Remove Programs (XP), Programs and Features (Vista).

              Delete the My Documents-->NinjaTrader 6.5 folder. Do not delete the NinjaTrader backup folder(!).

              Clear your browser cache and download and install NinjaTrader 6.5 at the link below.


              Restore your settings and you should be able to import new NinjaScript files again.
              JasonNinjaTrader Customer Service

              Comment


                #8
                thanks a lot, good advices!

                everything ok now, also the doji script.


                regards,

                Comment


                  #9
                  there is one bug with the script...

                  the doji script works well in the case of switching between a time frame and then go back to the initial period. but there is a bug when you stay in one time frame all the time. if you do so the indicator will draw the bars always in the color that is related to the small body bars.

                  what's wrong here?

                  Comment


                    #10
                    To be honest, I do not understand what you are talking about... could you explain what you are doing?

                    Originally posted by Risk Manager View Post
                    the doji script works well in the case of switching between a time frame and then go back to the initial period. but there is a bug when you stay in one time frame all the time. if you do so the indicator will draw the bars always in the color that is related to the small body bars.

                    what's wrong here?

                    Comment


                      #11
                      Just a model for paintbars

                      Saw what you mean, need to reset when the range of a bar exceeds the doji range. It was just an example how to code paint bars.....
                      Attached Files
                      Last edited by Harry; 03-20-2010, 04:59 PM. Reason: File updated

                      Comment


                        #12
                        now the indicator works fine

                        Originally posted by Harry View Post
                        Saw what you mean, need to reset when the range of a bar exceeds the doji range. It was just an example how to code paint bars.....
                        thank you very much harry and sorry for my bad explanations in the last post.

                        regards,
                        RM

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Barry Milan, Today, 10:35 PM
                        1 response
                        7 views
                        0 likes
                        Last Post NinjaTrader_Manfred  
                        Started by WeyldFalcon, 12-10-2020, 06:48 PM
                        14 responses
                        1,428 views
                        0 likes
                        Last Post Handclap0241  
                        Started by DJ888, Yesterday, 06:09 PM
                        2 responses
                        9 views
                        0 likes
                        Last Post DJ888
                        by DJ888
                         
                        Started by jeronymite, 04-12-2024, 04:26 PM
                        3 responses
                        40 views
                        0 likes
                        Last Post jeronymite  
                        Started by bill2023, Today, 08:51 AM
                        2 responses
                        16 views
                        0 likes
                        Last Post bill2023  
                        Working...
                        X