Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

back testing

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

    back testing

    I'm new to Ninja trader and the back testing system, i have a trading strategy i would like to back test and tweak if necessary it involves a level of custom coding, is it possible for the back testing system to calculate a previous days trading range between a specified time period e.g. between 8 o clock in the morning to 8 o clock the next morning?

    and can it calculate 15% of this and use it to set a trade entry?

    I will give an example, lets say a previous day traded a range of 100 pips between 8am and 8am the next morning, 15% of this being 15 pips, at the close of the 8 o clock hour candle i will place a buy order 15 pips above the close price and a sell signal 15 pips below the close price, this trade will have a 10 pip stop loss (trailing) and a 30 pip profit target

    #2
    Originally posted by adrian2014 View Post
    I will give an example, lets say a previous day traded a range of 100 pips between 8am and 8am the next morning, 15% of this being 15 pips, at the close of the 8 o clock hour candle i will place a buy order 15 pips above the close price and a sell signal 15 pips below the close price, this trade will have a 10 pip stop loss (trailing) and a 30 pip profit target
    Hello and welcome to the forums. This is something that is possible but does require custom coding to create. In order to make it run exactly as specified you would need to utalize the unmanaged approach. This approach gives coders a great deal of order flexibility but can also be difficult to new users.



    If your ENTRY orders do not need to be OCO you could create this using the managed approach and two systems (one for longs and one for shorts)


    Next comes the question of how to calculate the prior days range. This can be done a couple of different ways. It could be done by using your own internal tracking variables to look at the prior days high and low to find the difference of the two. Or you might be able to find an indicator already made that does this.

    For looking at the prior days OHLC: http://www.ninjatrader.com/support/h...r_day_ohlc.htm

    As I'm not sure you're previous coding experience please let me know if this content is above your head as we do have other solutions that involve the point and click interface of our Wizard or working with a consultant who can create it for you.

    Let me know how I can best further assist.
    LanceNinjaTrader Customer Service

    Comment


      #3
      Thank for your speedy reply
      i am new to programming therefore it would be difficult for me to put this together by my self, it might be better at this stage to see if the wizard or a consultant could help to put it together.
      In order for my strategy to be coded, do i need to alter some thing and how do i know what to write?

      thanks

      Comment


        #4
        In that case I would suggest starting here. It's a 1 hour long video teaching the basics of the Strategy wizard.

        You won't be able to get both entries open in opposite directions but you would potentially be able to use it to create two systems (one short and one long). The only caveat I see is calculating the entry price. This would require a custom indicator if using the wizard. You may be able to to find such an indicator out there on our forum or perhaps on BigMikes: https://www.bigmiketrading.com/



        If you want to get it cleanly coded and up and running smoothly I would suggest going the consultant route. Our third party consultants can be found here: http://www.ninjatrader.com/Ecosystem/NonBroker.php#81

        Let me know if I can further assist.
        LanceNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        367 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
        571 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X