Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to tell a Replay connection in ninjascript?

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

    How to tell a Replay connection in ninjascript?

    Hello, NinjaTrader 7 AND 8 please In NinjaScript, how can I discover which account the script is running against...in an Indicator, or Strategy? Could not find this in the documentation... Thanks

    #2
    Hello Turtle Trader,

    Indicators are not run on an account as these are not meant to place orders to any account.

    Indicators are designed to do calculations and add plots and other drawings to a chart.

    A Strategy does have an Account object.

    For NinjaTrader 7, this is undocumented, however the account object is 'Account'.
    Below is a link to a forum post with an undocumented example.


    For NinjaTrader 8, using the Account object is supported for Addons.
    Below are publicly available links to the NinjaTrader 8 help guide on the Account object.




    To find if the connection is the Playback connection:
    Cbi.Connection.PlaybackConnection != null
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      .................

      well, I need to disable "text to speech" on an indicator during Replay...because at max Replay speed (for backtesting) the voice is overwhelming and is unnecessary....during the regular market speed it is fine...the voice gives information on the bar time for active trading, but for back testing it is a burden on the system.

      I found this...it seems to work....in NT7

      if (Bars.MarketData.Connection.Name == "Market Replay Connection")

      replayConnection = true;

      Comment


        #4
        Hi Turtle Trader,

        That was my mistake. I gave you the code for NT8.

        Good job though.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        116 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        163 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        84 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        129 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        87 views
        0 likes
        Last Post PaulMohn  
        Working...
        X