Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

backtest error

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

    #16
    Please try script form 4:22 am

    Comment


      #17
      Hi tranta,

      I have tested your script from post 12.

      Attached are the results.

      Now that I have done this, please try clearing and re-downloading your historical data and try testing the file I have posted in post 11.
      Attached Files
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        I deleted hisitorical data as you said, and result is same. Only If change exit on close from False to True, it works. But dont want to exit on close.
        Attached Files
        Last edited by tranta; 08-20-2014, 10:39 AM.

        Comment


          #19
          Hello tranta,

          I am unable to reproduce these results even with Exit on close set to False.

          I would like to schedule a call with you to take a look on your end. Please send an email to platformsupport [at] ninjatrader [dot] com. In the email please add a link to this forum thread.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            Hello tranta,

            The issue is that you are placing up to 100 orders to the same variable using the same signal names. Because of this, the exit order is only exiting the last order preventing other full trades.

            To correct this, I have modified the script to make unique signal names for each entry and exit.

            Also, you were using the Position.AvgPrice + ProfitTarget * TickSize. The Position.AvgPrice is the entry point of all orders that make up that position. If there are 30 orders in, this will be an average entry price of all 30 orders.

            Then only orders that will be left over and closed on exit will be the orders placed at the top of a peak where the price never got back high enough to close the order.

            I have modified the script to only use the entry price of the entry order.
            Attached Files
            Chelsea B.NinjaTrader Customer Service

            Comment


              #21
              Hello, I´m sorry but there is misunderstanding. Strategy should enter in long position and if not reach profittarget so should enter second long position minus X ticks dilution etc, so averageposition price go down.

              Comment


                #22
                Hi tranta,

                If you had intended to use the Position.AvgPrice thats fine. You can change this code back. However, this will mean there will be more orders that do not fill.

                Also, you should be checking that Position.AvgPrice + ProfitTarget * TickSize is on the right side of the market price for that type of order to make sure that you exit order isn't rejected.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #23
                  hello, something like this? Still doesnt do what it should do(Arankaticks)
                  (DilutionTicks) works fine in backs but when I added sma from daily, that stop works
                  Attached Files
                  Last edited by tranta; 08-21-2014, 02:07 PM.

                  Comment


                    #24
                    Hi tranta,

                    This places the exit at the Position Avg Price (the average entry for all open orders) plus however many ticks is set in the ProfitTarget.

                    If this is not what you are wanting, what are you wanting?
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    648 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    369 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    108 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    572 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    574 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X