• 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

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
        http://www.ninjatrader-support2.com/...les#post145281
        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, 08: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.
              http://www.ninjatrader-support2.com/...ead.php?t=3418

              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(!).
              http://www.ninjatrader-support.com/H...upArchive.html

              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.
              http://www.ninjatrader.com/webnew/download_download.htm

              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, 03: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 pstrusi, Today, 09:06 AM
                        0 responses
                        5 views
                        0 likes
                        Last Post pstrusi
                        by pstrusi
                         
                        Started by vpzdcv, Today, 02:31 AM
                        0 responses
                        11 views
                        0 likes
                        Last Post vpzdcv
                        by vpzdcv
                         
                        Started by YevhenShynkarenko, Today, 01:22 AM
                        1 response
                        20 views
                        0 likes
                        Last Post YevhenShynkarenko  
                        Started by ttodua, Today, 12:52 AM
                        0 responses
                        8 views
                        0 likes
                        Last Post ttodua
                        by ttodua
                         
                        Started by ttodua, Today, 12:50 AM
                        0 responses
                        8 views
                        0 likes
                        Last Post ttodua
                        by ttodua
                         
                        Working...
                        X