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

Undocumented/Unsupported Ninja Tips and Tricks

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

    #16
    Using "ChartControl." and "graphics."

    Using "ChartControl." and "graphics."

    Last edited by eDanny; 08-14-2014, 12:24 PM.
    eDanny
    NinjaTrader Ecosystem Vendor - Integrity Traders

    Comment


      #17
      What is the 'CBI' namespace/class all about? I can't for the life of me unravel the acronym.

      Comment


        #18
        Originally posted by r2kTrader View Post
        TimeInForce = Cbi.TimeInForce.Opg; // Order on Open (interesting??)
        Hi, r2kTrader

        Thanks for posting this.

        What type of order situation is the above TimeInForce option for?

        Thanks

        Comment


          #19
          Draw lines on both price and subpanels



          Draw lines on both price and subpanels.
          Last edited by eDanny; 08-14-2014, 12:24 PM.
          eDanny
          NinjaTrader Ecosystem Vendor - Integrity Traders

          Comment


            #20
            Enumerate Form Controls

            Use the following code to enumerate the controls on the ChartForm...

            Code:
            [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]bool[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] _init = [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
            [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] _level = [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
            [/SIZE][/FONT]
            [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] OnBarUpdate()[/SIZE][/FONT]
            [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
            [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (!_init)[/SIZE][/FONT]
            [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
            [SIZE=2][FONT=Courier New]_init = [/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
            [SIZE=2][FONT=Courier New]LocateControls([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2].ChartControl.ParentForm);[/SIZE][/FONT]
            [SIZE=2][FONT=Courier New]} [/FONT][/SIZE]
            [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
            [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] LocateControls(Control c)[/SIZE][/FONT]
            [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
            [SIZE=2][FONT=Courier New]_level++;[/FONT][/SIZE]
            [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (c.Parent == [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
            [SIZE=2][FONT=Courier New]Print([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2].Format([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"(level={0})--->name={1} tostring={2} parent={3}"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2], _level, c.Name, c.ToString(), [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"NONE"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]));[/SIZE][/FONT]
            [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
            [SIZE=2][FONT=Courier New][SIZE=2][FONT=Courier New]Print([/FONT][/SIZE][/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2].Format([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"(level={0})--->name={1} tostring={2} parent={3}"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2], _level, c.Name, c.ToString(), c.Parent.Name));[/SIZE][/FONT]
             
            [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]foreach[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (Control c1 [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]in[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] c.Controls)[/SIZE][/FONT]
            [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
            [SIZE=2][FONT=Courier New]LocateControls(c1);[/FONT][/SIZE]
            [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
            [SIZE=2][FONT=Courier New]_level--;[/FONT][/SIZE]
            [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
            [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
            [/SIZE][/FONT]

            Comment


              #21
              Originally posted by hemlock View Post
              Use the following code to enumerate the controls on the ChartForm
              Convenient and useful tool. Thanks for sharing, Hemlock.

              Comment


                #22
                Originally posted by r2kTrader View Post
                This is a nifty little snippet.

                Did you ever have the need to "Flatten Everything". All strategies, and all open orders. Just get flat!

                NinjaTrader.Gui.SuperDom.SuperDom.FlattenEverythin g();

                I tested it and it seems to work ok. It killed all my strategies and got me flat on any orders that work working. I mean it took me FLAT! And fast.

                Test and use at your own risk.
                I have had great results with iof files per this thread


                instantly flat...and I do mean instantly...in NT7 I check the real time cash value (from broker/zenfire) and flatten on drawdown or target pnl etc

                Comment


                  #23
                  I posted EcoNews



                  There is a lot of "unsupported" stuff in the code.
                  Attached Files

                  Comment


                    #24
                    Very nice! Thanks for sharing.

                    Comment


                      #25
                      Very nice,

                      is this the version from http://www.johnthom.com/2009/12/snea...eader-for.html

                      that he promised on his site a while ago?

                      regards

                      Andreas
                      and happy coding


                      For the undocumented:

                      Here To define bitfields

                      [
                      Flags]
                      publicenumCountries {
                      JPY=0x01,
                      CNY=0x02,
                      GBP=0x04,
                      CHF=0x08,
                      EUR=0x10,
                      USD=0x20,
                      NZD=0x40,
                      AUD=0x80,
                      CAD=0x100
                      }

                      and you can also define a UITypeEditor for Flags to allow multiple selection. There is some stuff out on the net.



                      Comment


                        #26
                        Originally posted by zweistein View Post
                        Very nice,

                        is this the version from http://www.johnthom.com/2009/12/snea...eader-for.html

                        that he promised on his site a while ago?

                        regards

                        Andreas
                        and happy coding


                        For the undocumented:

                        Here To define bitfields

                        [Flags]
                        publicenumCountries {
                        JPY=0x01,
                        CNY=0x02,
                        GBP=0x04,
                        CHF=0x08,
                        EUR=0x10,
                        USD=0x20,
                        NZD=0x40,
                        AUD=0x80,
                        CAD=0x100
                        }

                        and you can also define a UITypeEditor for Flags to allow multiple selection. There is some stuff out on the net.


                        No this is not that version, although I used part of code for retrieving data from forexfactory website. (thanks johnthom)

                        Comment


                          #27
                          Cheers www.TradingStudies.com
                          Been looking forward to the new release from johnthom but you hvae got there first.

                          Comment


                            #28
                            Also just seen the Hide/Show News button at the top of the chart. Very nice.

                            Comment


                              #29
                              Economic News Indicator

                              Excellent Roonius. Many thanks for this. Also thanks for the 'open code' as I am sure it will help many of us trying to get to grips with learning C# and how it applies to Ninja.

                              Comment


                                #30
                                Thanks! I love this widget!

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by gyilaoliver, Today, 05:33 AM
                                4 responses
                                16 views
                                0 likes
                                Last Post gyilaoliver  
                                Started by anton_tymoshchuk, Today, 01:14 AM
                                2 responses
                                15 views
                                0 likes
                                Last Post anton_tymoshchuk  
                                Started by Epiphany79, Yesterday, 05:00 PM
                                1 response
                                14 views
                                0 likes
                                Last Post NinjaTrader_Gaby  
                                Started by tkaboris, Today, 07:52 AM
                                1 response
                                7 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Started by marco231, Yesterday, 11:32 PM
                                2 responses
                                11 views
                                0 likes
                                Last Post NinjaTrader_Jesse  
                                Working...
                                X