Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Trade Entry at close of the bar

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

    Trade Entry at close of the bar

    Hi... I am new to Ninjatrader 8. I have designed a strategy with EnterLong() and EnterShort() for long and short entry. my problem is it is taking entry at the open of the bar and I want it to take entry at the close of the bar. I have set calculate = Calculate.OnBarClose;

    Please help me. Thanks in advance.
    Himanshu Paliwal

    #2
    Hello palihimanshu,

    Thanks for your post and welcome to the NinjaTrader forums.

    Please note that you have posted in the NinjaTrader7 general development forum and have expressed code (calculate = Calculate.OnBarClose) that would be found in NinjaTrader8.

    Can you clarify if you are using NT7 or NT8.

    Can you clarify if you are using NT7, are you coding directly in Ninjascript or are using the Strategy Wizard?

    Can you clarify if you are using NT8, are you coding directly in Ninjascript or are using the Strategy Builder?

    In both cases, when you use CalculateOnbarClose, the strategy code is executed once at the end of each bar. If the code places the EnterShort() or EnterLong(), the market order would be filled on the next bar. You may want to have your strategy draw a marker on the chart when the conditions are true to place the order. You would then be able to see which bar the entry conditions were true followed by the actual entry on the next bar. Using drawing objects is a good visual reference and debugging technique on the chart. (Draw something when the conditions are true).



    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hello NinjaTrader_PaulH,

      I am using NT8. Your reply was very helpful. Thanks a lot for that.

      Now I have another problem. When I load Stock SBIN in chartWhich is an Indian stock traded on NSE (National Stock Exchange, India), It shows me the data in historical data segment but does show in chart for some particular date like 1 April 2016.

      My question is "Does NT8 has any trading day list of NSE?"

      Does it refer that list to make chart from data? if yes can I edit that list?

      Where can I find that list?

      Thanks in advance.
      Himanshu Paliwal

      Comment


        #4
        Hello palihimanshu,

        Thanks for your reply.

        We will move this thread to the NT8 strategy forum.

        NinjaTrader does not provide historical data for equities. You would need to contact your data feed provider for how much historical data they provide.
        In NinjaTrader when you create a chart, the data series defines how many "days to load" (and there are other options there). Typical default for daily bars would be 365 days.
        I may not be understanding your questions, please feel free to ask again perhaps differently or with a chart example.
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by adeelshahzad, Today, 03:54 AM
        4 responses
        22 views
        0 likes
        Last Post adeelshahzad  
        Started by merzo, 06-25-2023, 02:19 AM
        10 responses
        823 views
        1 like
        Last Post NinjaTrader_ChristopherJ  
        Started by frankthearm, Today, 09:08 AM
        5 responses
        15 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        43 views
        0 likes
        Last Post jeronymite  
        Started by yertle, Today, 08:38 AM
        5 responses
        16 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X