Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

instrument.ToString

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

    instrument.ToString

    Hello,

    with position.ToString I can draw in the chart informations about the trade.

    But I couldnt find in the helpguide and forum how to do like "instrument.ToString". I want to drawtext for the instrument in the chart directly (because I remove the title-bar and the toolbar) - no matter if a position is on or flat.

    How can I do this simply drawtext? couldnt find it.

    Thanks
    Tony

    #2
    Hello,

    You can use Instrument.MasterInstrument.Name to get the string name of the instrument http://www.ninjatrader.com/support/h...trument_na.htm

    Let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment


      #3
      Hello,

      thank you.

      And please how can I draw the dataseries beside (minutes, range...)?

      Thanks
      Tony

      Originally posted by NinjaTrader_Lance View Post
      Hello,

      You can use Instrument.MasterInstrument.Name to get the string name of the instrument http://www.ninjatrader.com/support/h...trument_na.htm

      Let me know if I can be of further assistance.

      Comment


        #4
        You can use BarsPeriod.BasePeriodType:


        MatthewNinjaTrader Product Management

        Comment


          #5
          Hello,

          thanks for your reply. Another question please: does ChangeOrder work only in unmanaged mode?

          Thanks
          Tony

          Originally posted by NinjaTrader_Matthew View Post
          You can use BarsPeriod.BasePeriodType:


          http://www.ninjatrader.com/support/h...barsperiod.htm

          Comment


            #6
            Hello,

            Yes that is correct. You can use IOrders to cancel or change the location of an existing order without the unmanaged approach: http://www.ninjatrader.com/support/h...r_handling.htm



            Let me know if I can be of further assistance.
            LanceNinjaTrader Customer Service

            Comment


              #7
              Hello,

              thank you for your reply. Cancelorder I use already. But changeorder can be used as well without unmanaged mode?

              Or do you mean "new order and cancel old order = changeorder"? If so, is it 100% the same as with "new and cancel" there´s a moment eg without stop, but with changeorder the stop is always there(?)

              Thanks
              Tony

              Originally posted by NinjaTrader_Lance View Post
              Hello,

              Yes that is correct. You can use IOrders to cancel or change the location of an existing order without the unmanaged approach: http://www.ninjatrader.com/support/h...r_handling.htm



              Let me know if I can be of further assistance.

              Comment


                #8
                ChangeOrder() cannot be used without the unmanaged mode

                I linked references to advanced order handling as this would allow you to either move your existing order OR cancel your order and place a new order.
                LanceNinjaTrader Customer Service

                Comment


                  #9
                  Hello,

                  when I do

                  DrawTextFixed("Instrument", Instrument.MasterInstrument.Name.ToString() + " " + BarsPeriod.Value + " " + BarsPeriod.BasePeriodType , TextPosition.TopLeft,Color.Black, new Font ("Arial",10), Color.Black,Color.White,10);


                  and I change dataseries from Minute to Range then there still is drawn "Minute". The Value is correct, but still "Minute" and not "Range". Why? Can you please tell me what is the error in my syntax here?

                  Thanks
                  Tony

                  Originally posted by NinjaTrader_Matthew View Post
                  You can use BarsPeriod.BasePeriodType:


                  http://www.ninjatrader.com/support/h...barsperiod.htm

                  Comment


                    #10
                    Hello,

                    You will want to use

                    BarsPeriod.Id

                    Instead of

                    BarsPeriod.BasePeriodType

                    Let me know if I can be of further assistance.
                    LanceNinjaTrader Customer Service

                    Comment


                      #11
                      Thank you!

                      Is there a way so that the corresponding dataseries type (as it appears in the dataseries menu) for Final() and Custom() is drawn?

                      Best
                      Tony

                      Originally posted by NinjaTrader_Lance View Post
                      Hello,

                      You will want to use

                      BarsPeriod.Id

                      Instead of

                      BarsPeriod.BasePeriodType

                      Let me know if I can be of further assistance.

                      Comment


                        #12
                        Are these custom bar types you're using?
                        MatthewNinjaTrader Product Management

                        Comment


                          #13
                          Hello,

                          yes, therefore I´m asking.

                          Best
                          Tony

                          Originally posted by NinjaTrader_Matthew View Post
                          Are these custom bar types you're using?

                          Comment


                            #14
                            The ID is going to give you the inderlying ID. If you want to display what is formatted on the chart, you'd need to create a custom string that displays this for you:

                            Code:
                            			if(BarsPeriod.Id.ToString() == "Final2")
                            			{
                            				string myBarID = "WickedRenko";
                            					Print(myBarID);
                            			}
                            MatthewNinjaTrader Product Management

                            Comment


                              #15
                              Thank you!

                              But I can not make it to work with:

                              if(BarsPeriod.Id.ToString() == "Custom2")
                              {
                              string Id = "RangeNoGap";
                              Print(Id);
                              }


                              DrawTextFixed("Instrument", Instrument.MasterInstrument.Name.ToString() + " " + BarsPeriod.Value + " " + BarsPeriod.Id , TextPosition.TopLeft,Color.Black, new Font ("Arial",10), Color.Black,Color.White,10);

                              Thanks
                              Tony


                              Originally posted by NinjaTrader_Matthew View Post
                              The ID is going to give you the inderlying ID. If you want to display what is formatted on the chart, you'd need to create a custom string that displays this for you:

                              Code:
                                          if(BarsPeriod.Id.ToString() == "Final2")
                                          {
                                              string myBarID = "WickedRenko";
                                                  Print(myBarID);
                                          }
                              Last edited by tonynt; 03-20-2013, 09:11 AM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by MacDad, 02-25-2024, 11:48 PM
                              7 responses
                              158 views
                              0 likes
                              Last Post loganjarosz123  
                              Started by Belfortbucks, Today, 09:29 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post Belfortbucks  
                              Started by zstheorist, Today, 07:52 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post zstheorist  
                              Started by pmachiraju, 11-01-2023, 04:46 AM
                              8 responses
                              151 views
                              0 likes
                              Last Post rehmans
                              by rehmans
                               
                              Started by mattbsea, Today, 05:44 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post mattbsea  
                              Working...
                              X