Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Newbie Help

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

    Newbie Help

    Hi all,

    I am trying to back test a very simple strategy, but I am new to NT and can't seem to get very far. Here is what I am trying to do.

    1) When certain conditions are met, enter the market with 2 contracts and a 10 tick S/L.
    2) Take profit on 1 contract at 10 ticks and move the stop on the other to break even + 1 tick.
    3) Trail the stop on the running contract. The trail has to tighten as the market moves more favorably. So if the initial trail is 10 ticks, then after a threshold of say 20 ticks, the trail has to tighten to 5 ticks and so on. If possible, I would like to be able to define 2 such thresholds.

    I would really appreceate some guidance on how to set this up using the strategy wizard as I am not much of a programmer.

    Thanks a lot.

    #2
    Unfortunately what you want to do is not so simple for the Strategy Wizard. We have reference samples available that you can see to get an idea of how to program this though. You can view it here: http://www.ninjatrader-support.com/v...ead.php?t=3751


    As a last resort you may also try contacting one of the NinjaScript Consultants here: http://www.ninjatrader.com/webnew/pa...injaScript.htm

    What I suggest you try is to use the Strategy Wizard to setup your initial conditions and the placement of your initial order. Then you will need to unlock your code and add in the techniques shown in the reference samples.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Calculate on bar close

      Thanks for the reply, Josh.
      I looked at the samples and I think I have figured it out. I just have a quick question about the "Calculate on bar close" field.
      In my system, I would like the entry condition to be evaluated on the close of a bar. However, since I am moving my stop to break even manually when a certain level of profit is reached, I would not want to wait for a bar close to perform that calculation. The stop needs to move to break even as soon as the market hits my profit target regardless of whether or not a bar closes above it.

      So the entry condition must be evaluated on bar close, while the position management conditions need to be evaluated on a tick-by-tick basis.

      How would I achieve this behavior?
      Thanks again for the support. I really appreciate it.

      Comment


        #4
        Run with "CalculateOnBarClose" but filter for "FirstTickOfBar" and use that to calculate entry conditions. Keep in mind, that you are now on a new bar so check the condition of 1 bar ago for your entry logic.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        672 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X