• 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

Best way to manage account

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

    Best way to manage account

    I would like to write a strategy that helps me to stop trading when I am having a bad day.
    I would like to monitor the account value and ultimately found out which are my losses.
    I then need to read the actual overall account cash value and if I am flat, if I have any position open so I know that my numbers are correct.
    What are the proper code instructions tot do this? Any suggestion?
    Maybe I can then later think to differentiate the evaluation based on symbol but this could be a later project.
    Thank You.
    G

    #2
    Hello giogio1,

    Are the entry orders submitted by a fully automated NinjaScript Strategy or are these manually placed orders?

    For a NinjaScript Strategy it is possible to prevent new entries using logic. Below is a link to an example made for NinjaTrader 7.
    http://ninjatrader.com/support/forum...241#post451241

    If the orders are manually placed orders there are no supported methods to prevent these. My suggestion would be to use a NinjaScript Strategy that adds buttons to the chart. When the button is manually pressed this triggers the strategy to submit the order through the strategy. With this the logic could be in place to decide if the order is submitted.
    Below is a link to an example of submitting orders from a button click through a NinjaScript Strategy.
    https://ninjatraderecosystem.com/use...olbar-buttons/


    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chelsea. Your answer address two aspects of my question. I am also look into using in the script the functions of SystemPerformance.RealtimeTrade of NT7.
      I would like to get the Cash available in the account and if I have any open position left and possibly also the daily P&L but I want to look at my actual broker account numbers, not what reside in my computer. This script would look into the account numbers regardless of whether the trades were executed manually or via a strategy.
      From that I would follow your suggestion to create appropriate buttons or feed the information into a running strategy.

      In other words I would like to get the main numbers that appear in the Accounts tab and possibly Positions
      tab of the control center from a script.
      Best
      Giogio

      Comment


        #4
        Hello Giogio,

        GetAccountValue() can be used to get the CashValue and RealizedProfitLoss as seen in the Accounts tab of the Control Center.

        Get CashValue() - https://ninjatrader.com/support/help...countvalue.htm

        While not documented/supported in NinjaTrader 7, you could check the Account's Position collection to check open positions on the account. Checking the NinjaTrader 8 documentation can help to give some hints, although we cannot make the same guarantees as the NinjaTrader 8 documentation. What you try should be checked in NT7 to see if it works the same way and can be used for your needs.

        NT8 Account object - https://ninjatrader.com/support/help...ount_class.htm

        NT8 Account Positions collection - https://ninjatrader.com/support/help...ns_account.htm

        NT7 IPosition - https://ninjatrader.com/support/help.../iposition.htm

        Code:
        if (Historical)
            return;
        Print(GetAccountValue(AccountItem.CashValue));
        foreach (IPosition pos in Account.Positions)
        {
            Print(pos.Instrument + " " + pos.MarketPosition);
        }
        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rontronimous, Today, 05:55 PM
        0 responses
        5 views
        0 likes
        Last Post rontronimous  
        Started by bcgeek, Today, 03:43 PM
        2 responses
        6 views
        0 likes
        Last Post bcgeek
        by bcgeek
         
        Started by Mberg, Today, 04:05 PM
        0 responses
        7 views
        0 likes
        Last Post Mberg
        by Mberg
         
        Started by dkbyond, Today, 03:52 PM
        0 responses
        4 views
        0 likes
        Last Post dkbyond
        by dkbyond
         
        Started by Newtrader101, Today, 03:09 PM
        2 responses
        5 views
        0 likes
        Last Post Newtrader101  
        Working...
        X