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 elliot5, Today, 03:28 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by pjsmith, 09-25-2022, 07:13 AM
        7 responses
        57 views
        0 likes
        Last Post pjsmith
        by pjsmith
         
        Started by knarfoe, 09-23-2021, 05:19 AM
        7 responses
        66 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by EstheYund, Today, 01:56 AM
        0 responses
        14 views
        0 likes
        Last Post EstheYund  
        Started by Daveman0, 09-25-2022, 11:14 PM
        4 responses
        46 views
        0 likes
        Last Post jeronymite  
        Working...
        X