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 Tim-c, Today, 03:54 AM
        0 responses
        3 views
        0 likes
        Last Post Tim-c
        by Tim-c
         
        Started by FrancisMorro, Today, 03:24 AM
        0 responses
        2 views
        0 likes
        Last Post FrancisMorro  
        Started by Segwin, 05-07-2018, 02:15 PM
        10 responses
        1,771 views
        0 likes
        Last Post Leafcutter  
        Started by Rapine Heihei, 04-23-2024, 07:51 PM
        2 responses
        31 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by Shansen, 08-30-2019, 10:18 PM
        24 responses
        945 views
        0 likes
        Last Post spwizard  
        Working...
        X