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

enter position on bar close

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

    enter position on bar close

    hello,
    i'm trying to develop a strategy on renko bars and i would like the entry price to be at the close of the bar which triggered the entry.
    im developing the strategy with the wizard and don't really know anything about codes writing.
    how can i solve this problem??

    tyvm moshe.

    #2
    Hello mush1983,
    Welcome to the forum and I am happy to assist you.

    If you set Calculate on bar close to true, from the strategy parameter box then are you able to submit the order at the end of the bar.
    Attached Files
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      tyvm for the fast answer...!
      but, i would like to make a backtest on the strategy at the same way,
      how can i do that?

      tyvm again.

      Comment


        #4
        Hello mush1983,
        In backtest (or when the strategy is evaluating the historial bars) the strategy will be evaluated on the end of the bars only (even if you set Calculate on bar close to false).
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Also on renko bars?
          from what i see on renko bar it's not like that, am i wrong?

          Comment


            #6
            Hello mush1983,
            If you set Calculate on bar close to true, then the logic will be evaluated at the end of the bar. This is true for any bars type including Renko.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              but calculate on bar close is for running the strategy not for the analyzer.
              my strategy numbers are to good to be true i know that something is wrong,
              i don't know, i'm pretty sure on renko it's different specially with the market analyzer.

              Comment


                #8
                Sorry, do you mean strategy analyzer for backtesting, or the market analyzer for real-time scanning?
                MatthewNinjaTrader Product Management

                Comment


                  #9
                  backtesting..

                  Comment


                    #10


                    how come the buy to cover is at the open price of the red bar, this price wasn't the market real price at the time...
                    it should have been executed on the green bar close.

                    Comment


                      #11
                      Hello,

                      When backtesting, all events are processed at the end of the bar. In the case of market orders, they are executed at the opening price of the next bar.

                      If you would like more realistic backtesting in terms of your renko bars, I would suggest using the Market Replay feature instead.
                      MatthewNinjaTrader Product Management

                      Comment


                        #12
                        so from what u say i understand there is no way to backtest renko bars strategy when the price is at the close of the triggering bar..?

                        Comment


                          #13
                          It is possible, but you would need to use a finer series, such as a 1 tick series to execute on. This will take additional coding.

                          Please see our Reference Sample on backtesting using Intrabar granularity:

                          You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by
                          MatthewNinjaTrader Product Management

                          Comment


                            #14
                            Originally posted by mush1983 View Post
                            Also on renko bars?
                            from what i see on renko bar it's not like that, am i wrong?
                            In Backtest and Optimizing, it would appear to be. Do not be deceived, especially if you end up with stellar backtest results (unless of course it is an always-in Stop&Reverse strategy).

                            Your real, live, results are liable to be completely different, because of the way that Renko Bars ignore excursions beyond what they draw. Test your so-called stellar results in Market Replay before you attempt to draw any conclusions.
                            Last edited by koganam; 12-31-2012, 02:37 PM.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by pechtri, 06-22-2023, 02:31 AM
                            11 responses
                            135 views
                            0 likes
                            Last Post Nyman
                            by Nyman
                             
                            Started by ageeholdings, 05-01-2024, 05:22 AM
                            4 responses
                            27 views
                            0 likes
                            Last Post ageeholdings  
                            Started by hdge4u, 04-29-2024, 12:23 PM
                            4 responses
                            22 views
                            0 likes
                            Last Post NinjaTrader_RyanS  
                            Started by z679Gju, Today, 02:37 PM
                            1 response
                            7 views
                            0 likes
                            Last Post NinjaTrader_Jesse  
                            Started by mintos, 04-02-2024, 08:22 PM
                            11 responses
                            48 views
                            0 likes
                            Last Post NinjaTrader_ChelseaB  
                            Working...
                            X