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

How to obtain the residual height of the mouth seat

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

    How to obtain the residual height of the mouth seat

    I tried the following code to retrieve my account balance, but it did not work.

    #region Using declarations
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Gui;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Gui.SuperDom;
    using NinjaTrader.Gui.Tools;
    using NinjaTrader.Data;
    using NinjaTrader.NinjaScript;
    using NinjaTrader.Core.FloatingPoint;
    using NinjaTrader.Gui.Tools;
    #endregion

    //This namespace holds Add ons in this folder and is required. Do not change it.
    namespace NinjaTrader.NinjaScript.AddOns
    {
     public class myAccont2 : NinjaTrader.NinjaScript.AddOnBase
     {
      Account a = Account.All.First(t => t.Name == "Sim101");
      double value = a.Get(AccountItem.CashValue, Currency.UsDollar);
      Print(value);
     }
    }

    #2
    Hello ラリー,

    As this is an addon, I would recommend that this be run when a new window is opened or when a button is clicked.
    Below is a link to an example that uses an account.


    Further, instead of using Print() you would need to use Code.Output.Process() to print to the output window from an addon.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      ご返事ありがとうございます。
      私はコードを変更しました、それはここで正しいですか?

      #region Using declarations
      using System;
      using System.Collections.Generic;
      using System.ComponentModel;
      using System.ComponentModel.DataAnnotations;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Windows;
      using System.Windows.Input;
      using System.Windows.Media;
      using System.Xml.Serialization;
      using NinjaTrader.Cbi;
      using NinjaTrader.Gui;
      using NinjaTrader.Gui.Chart;
      using NinjaTrader.Gui.SuperDom;
      using NinjaTrader.Gui.Tools;
      using NinjaTrader.Data;
      using NinjaTrader.NinjaScript;
      using NinjaTrader.Core.FloatingPoint;
      using NinjaTrader.Gui.Tools;
      #endregion

      //This namespace holds Add ons in this folder and is required. Do not change it.
      namespace NinjaTrader.NinjaScript.AddOns
      {
      public class myAccont2 : NinjaTrader.NinjaScript.AddOnBase
      {
      Account a = Account.All.First(t => t.Name == "Sim101");
      double value = a.Get(AccountItem.CashValue, Currency.UsDollar);
      Code.Output.Process();
      }
      }
      Attached Files

      Comment


        #4
        Hello ラリー,

        No, Code.Output.Process() requires a string that will be printed and the output tab it will go to.

        From the help guide;
        "NinjaTrader.Code.Output.Process("my message", PrintTo.OutputTab1);"

        When do you want this output to appear? I am recommending that this be in the Loading event handler method for a new window, or from a button press. See my example linked for a demonstration.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I'm sorry, I referred to the link, but I didn't understand it very well, and I changed the code again here, is this (attached) correct?
          Also, from where do I see the log when an error is output?
          Attached Files

          Comment


            #6
            Hello ラリー,

            Below I am providing a link to a forum post with helpful information about getting started with C#.


            As well as an example addon that has a button.


            The Code.Output.Process() in your post has the right format, however you would want to change the string to the information you are wanting to print.

            The Log tab can be selected at the bottom of the Control Center window.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thank you very much.
              I will give them a try.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by egordleo, Today, 05:50 AM
              0 responses
              4 views
              0 likes
              Last Post egordleo  
              Started by kevinenergy, 02-17-2023, 12:42 PM
              118 responses
              2,778 views
              1 like
              Last Post kevinenergy  
              Started by briansaul, Today, 05:31 AM
              0 responses
              9 views
              0 likes
              Last Post briansaul  
              Started by fwendolynlpxz, Today, 05:19 AM
              0 responses
              4 views
              0 likes
              Last Post fwendolynlpxz  
              Started by traderqz, Yesterday, 12:06 AM
              11 responses
              28 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Working...
              X