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 gentlebenthebear, Today, 01:30 AM
        2 responses
        13 views
        0 likes
        Last Post gentlebenthebear  
        Started by Kaledus, Today, 01:29 PM
        2 responses
        7 views
        0 likes
        Last Post Kaledus
        by Kaledus
         
        Started by frankthearm, Yesterday, 09:08 AM
        13 responses
        45 views
        0 likes
        Last Post frankthearm  
        Started by PaulMohn, Today, 12:36 PM
        2 responses
        16 views
        0 likes
        Last Post PaulMohn  
        Started by Conceptzx, 10-11-2022, 06:38 AM
        2 responses
        56 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Working...
        X