Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

auto trading

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

    auto trading

    Hello, I'm new to Ninja trader. I have a few questions about strategy builder and analyzer. I wanted to create a time based auto trade that bought 2 stocks at the start of the bell and automatically place stop limits on both instantly. Then sell all positions at a certain time of the day. This seems pretty simple, yet I'm struggling with nothing coming up on back testing. If i can get everything working properly I want to fund my account with 30k.

    Thank you for your time!

    #2
    Hello Tirosovan,

    Thanks for your post and welcome to the NinjaTrader Forums!

    Time Comparison conditions could be added to a Strategy Builder strategy to check if the current time is a specific time.

    You could create a Time Comparison condition in your script and then create an action to place an order, such as EnterLong() (Order Management folder > Enter long position).

    The Stops and Targets screen of the Strategy Builder can be used to set up a stop limit order for the entry (Stops and Targets screen > add > Stop loss).

    If you want to exit the position at a specific time of day then you could create another Time Comparison condition that checks if the time is that specific time you want to exit, and then create an action to place an exit order, such as ExitLong() (Order Management folder > Exit long position).

    See the help guide documentation below for more information about the different Strategy Builder screens, creating Time Comparison conditions, and placing orders.

    Builder Screens: https://ninjatrader.com/support/help...er_screens.htm
    Conditions: https://ninjatrader.com/support/help...on_builder.htm
    Actions: https://ninjatrader.com/support/help...t8/actions.htm

    For information about backtesting a NinjaScript strategy, see this help guide page: https://ninjatrader.com/support/help...a_strategy.htm

    Note that you will need to have access to Historical data for the instrument and dates you are wanting to test the strategy on.

    Please see the available historical data from the servers below.
    • Tick data: up to 1 year of historical data would be available. However, some instruments may go back further.
    • Minute data: virtually never deleted, goes back to 2006 (Forex goes back to late 2008).
    • Daily data: virtually never deleted, goes back to 2009. Forex data varies per instrument. Index data goes back to 2011.
    • Market Replay data: deleted after 90 days. (Used only for the Playback connection)
    If the strategy is not behaving as expected in the Strategy Analyzer, I recommend testing the SampleMACrossover strategy that comes with NinjaTrader to see if you get results over the data you are backtesting. If you see results when testing the SampleMACrossover strategy but not when backtesting your custom strategy, debugging steps should be taken to understand exactly how the logic in your script is behaving.

    In the strategy add prints (outside of any conditions) that print the values of every variable used in every condition that places an order along with the time of that bar.

    Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

    Also, enable TraceOrders which will let you know if any orders are being ignored and not being submitted when the condition to place the orders is evaluating as true.

    Below is a link to a forum post that demonstrates how to use prints to understand behavior.


    ​Please let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      When i run anything, nothing happens. Maybe because I'm not paying for live data?

      Comment


        #4
        Hello Tirosovan,

        Thanks for your notes.

        To run a backtest in the Strategy Analyzer window you must be connected to a data feed in the Control Center > Connections menu and have access to Historical data.

        The help guide documentation below lists the supported data feed providers and the type of data they provide.

        Data By Provider: https://ninjatrader.com/support/help...y_provider.htm

        What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)

        Who are you connected to? This is displayed in green on the lower-left corner of the Control Center window.

        We look forward to assisting further.
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Hi BrandoinH,

          8.1.2.1 64-bit

          I just purchased the Kinetick service. However, when i search for #2 on the steps below, I do not have such option in Ninjatrader.

          Kinetick Real Time Service
          • Start NinjaTrader
          • From within the Control Center window, select the menu "Tools > Account Connections…"
          • In the Account Connection Set Up window, press the "Add…" button
          • Follow the instructions provided in the Connection Wizard
          • Enter Your Kinetick user name and password
          • For back adjusted continuous futures contract data enable "Use back adjusted data

          Comment


            #6
            Hello Tirosovan,

            Enable Multi-provider mode to allow connections to other supported data feeds and brokerages.

            Below is a link to the support article with instructions.
            https://support.ninjatrader.com/s/article/How-To-Enable-Multi-Provider-on-NinjaTrader-Desktop
            https://support.ninjatrader.com/s/article/Connecting-To-Your-Kinetick-Data-Connection
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thank you Chelsea! I got the feed to work and am now tinkering with back testing.

              I have a new question.

              One of my ETF stocks are not pulling up on the charts.

              It says "Error on requesting bars series: Unable to load historical data: Unknown instrument "NUGT"




              Comment


                #8
                Hello Tirosovan,

                Thanks for your notes.

                This error message indicates that you are not subscribed to historical data for this instrument.

                You should reach out to your data provider (Kinetick) directly to ensure you are subscribed to historical data for this instrument.

                Brandon H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by fx.practic, 10-15-2013, 12:53 AM
                5 responses
                5,403 views
                0 likes
                Last Post Bidder
                by Bidder
                 
                Started by Shai Samuel, 07-02-2022, 02:46 PM
                4 responses
                94 views
                0 likes
                Last Post Bidder
                by Bidder
                 
                Started by DJ888, Yesterday, 10:57 PM
                0 responses
                6 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by MacDad, 02-25-2024, 11:48 PM
                7 responses
                158 views
                0 likes
                Last Post loganjarosz123  
                Started by Belfortbucks, Yesterday, 09:29 PM
                0 responses
                8 views
                0 likes
                Last Post Belfortbucks  
                Working...
                X