Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with setting up the strategy

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

    Help with setting up the strategy

    I would like to create a strategy in NT (and run test) that have following simple rules, and i wonder if anyone could help me build it in NT:

    - take first 1/2 hour after market opens to establish a range (High/Low)
    - only take trade in second 1/2 hour after open, if:
    - breakout happens above or below first 1/2 hour range, and take trade on first close back in the first 1/2 hour range. If break happens above the range go short on close back in the range, and if break is below range go long on first close back in the range.
    - use 1 min bars
    - if still in the trade at the End of day, exit on market
    - I think i know how to play with stops and targets, but say initially set 10 tick stop and 20 tick tgt.

    Any suggestions on how to code it appreciated

    Thanks

    #2
    Hello bagzi,

    Thank you for your post.

    For the first, second and fifth steps here I would use a time filter to establish the range and trading period. For a reference sample on using a time filter please visit the following link: http://www.ninjatrader.com/support/f...ead.php?t=3226

    For the third step and determining the High and Low of a set time frame please refer to the following forum thread for information on using the time filter to establish this method as well: http://www.ninjatrader.com/support/f...ad.php?t=47635

    The fourth step will be determined when you enable the strategy on your chart or the Strategies tab of the Control Center. Please visit the following link for information on working with Strategies: http://www.ninjatrader.com/support/h...strategies.htm

    And setting up the Stop Loss and Profit Target can be done through the Strategy Wizard fairly simply.
    For information on the Strategy Wizard please visit the following link: http://www.ninjatrader.com/support/h...egy_wizard.htm
    For information on SetStopLoss() please visit the following link: http://www.ninjatrader.com/support/h...etstoploss.htm
    For information on SetProfitTarget() please visit the following link: http://www.ninjatrader.com/support/h...ofittarget.htm

    Please let me know if I may be of further assistance.

    Comment


      #3
      Thanks, ill look into it and if i have more questions will post here

      Comment


        #4
        Hello,

        i am trying to import the script that is suggested on one of the pages u linked above, but i get the message:
        "You have custom NinjaScript files on your PC that have programming errors. These errors must be resolved before you can import a NinjaScript Archive file."

        Now, i am not sure what are these files with programming error. I have bunch of stuff from the forum, plus some paid indicators. Can u suggest what to do so i can import this file?

        Thanks

        Comment


          #5
          bagzi, please first of all run through those steps mentioned in the post below to see where the issues are exactly coming from - http://www.ninjatrader.com/support/f...ead.php?t=4678

          If you like, post a screenshot here of the compile issues found and we can respond back with the next best step.
          BertrandNinjaTrader Customer Service

          Comment


            #6
            I had one strategy that was not coded properly, since i am trying to learn this stuff. I deleted it and now it imported script successfully. Is this really the way it should be that u are unable to import the script if some strat is in a development mode?

            Comment


              #7
              Yes, that would explain the issue you saw - all scripts (indicators and strategies) are compiled into one assembly file to be used at runtime for highest performance possible, which means they all would need to be in compilable state. You could comment 'working status' code section fully out to the compile still happen.
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by hazylizard, Today, 08:38 AM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by geddyisodin, Today, 05:20 AM
              2 responses
              16 views
              0 likes
              Last Post geddyisodin  
              Started by Max238, Today, 01:28 AM
              5 responses
              43 views
              0 likes
              Last Post Max238
              by Max238
               
              Started by giulyko00, Yesterday, 12:03 PM
              3 responses
              13 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by habeebft, Today, 07:27 AM
              1 response
              16 views
              0 likes
              Last Post NinjaTrader_ChristopherS  
              Working...
              X