Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Scaling in using the strat wizard

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

    Scaling in using the strat wizard

    Hi I'm brand new to NT and am working in the Strat Wizard. I program in another platform and am trying to translate a system into NT for auto trading.

    What I need to know is how can I in the wizard scale in a second position when a close is lower than the origional entry?

    In my current platform I enter the first position when an oscillator goes below a threshold, this is Entry1 and I use a FLIP function to latch this Entry event as true until and exit signal occurs or Entry2 occurs which is when the close is < the valuewhen Entry1 latched true.

    Any help or direction in learning how to scale in using the wizard would be much appreciated.

    Thanks!

    #2
    Hello,

    Thank you for your first forum post!

    Please see this reference sample on how to code this:

    http://www.ninjatrader.com/support/f...ead.php?t=3751

    Also another forum thread on this started with using the strategy wizard:

    http://www.ninjatrader.com/support/f...trategy+wizard



    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      Thank you for the quick and comprehensive response. I'm impressed!!!

      Comment


        #4
        Originally posted by NinjaTrader_Brett View Post
        Hello,

        Thank you for your first forum post!

        Please see this reference sample on how to code this:

        http://www.ninjatrader.com/support/f...ead.php?t=3751

        Also another forum thread on this started with using the strategy wizard:

        http://www.ninjatrader.com/support/f...trategy+wizard



        Let me know if I can be of further assistance.
        Brett
        Thanks again for the direction, I don't think I worded my problem properly. I understand concepts of scaling in as addressed in the links you sent. My issue is getting the wizard to recognize the price level at the initial buy, as the new buy threshold for the second buy.
        For example:
        An oscillator tiggers a buy at $10.25 and BUY1 is tripped.
        $10.25 becomes the new buy threshold. (This line is the problem!!!)
        If any close in the future goes below $10.25 (before triping the exit) BUY2 is made.

        So set2 in the wizard would be C < "$10.25" (but this is a dynamic variable not a static number) go long BUY2

        I've tryed to get the Strat wizard to recognize "$10.25" as the new buy threshold by telling it that when all the events for BUY1 occur go long and variable0==close[0] but that didn't work.

        I don't know how much you guys can help with programming for free (most companies won't) so if this is asking to much from the forum I am willing to pay for help learning NT. Please direct if you know of such help.

        Thanks for any bone you can throw and old dog!

        mike

        Comment


          #5
          Hello onionsturtle,

          Your approach is good for capturing this value using the condition builder. You might also need to reset it when you're flat. Your 2nd entry only comes into effect when you're already in a position so checking when market position == long should work well for this. If it continues not to work as you expect, may need to get in the code view and add Print() statements to verify that values are what you expect.

          You may also want to use the built in property Position.AvgPrice, which is available from the strategy wizard. This is available under strategy > Average Position Price.

          We don't provide custom coding or debugging services here but are happy to aid in the right direction and comment on any progress you make. If you're looking to hire someone to code NinjaScript, can see a list of our 3rd party NinjaScript consultants here:
          http://www.ninjatrader.com/webnew/pa...injaScript.htm
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            Thanks again. I did use the Position Quantity == 1000 to initiate a second trade, That solved one issue; but the wizard is still having a hard time seeing when the current close is lower than the close at the time of the first buy signal.

            I only have 2 condtions for the second buy:
            1) Position Quantity == 1000
            2) Close[0] < Variable0
            I set variable0 when the first buy occured to - Close[(int) (MarketPosition.Long)]
            This causes very random second positions. Some non-existant, some several days after thay should have fired, etc.

            I have a few questions:
            1) How would you set Variable0 to reflect the closing value of the first buy bar?
            2) All the trades are occuring on the next days open. Can this be switched to the signal bars close?
            3) Can NT trade a system on the markets close, or can it be programmed to evaluate signals at 3:55PM EST and place the appropriate trade?
            4) You said I might need to reset the system when I am flat. How is this programmed in the wizard, if it can be?

            Thanks for your willingness to help me out.
            mike

            Comment


              #7
              1. You would need to do this in the Strategy Action window for when the first bar is true.

              2. No, this would not be possible. All trades go onto the bar after the signal bar because the signal bar is already closed and it has no tradeable locations left on it. When you are backtesting you are using snapshot OHLC data and because you have that close for each bar, it means all of your signals were generated at the moment the bar closed. Next tradeable location is the open of the next bar and that is where the trades are shown.

              3. This is both possible. You just need to use intraday granularity data to achieve this. This means running your strategy maybe on a 1min chart for example.

              4. What Ryan meant was any variables (like Variable0) you may have set to a certain value will need to be reset to 0 when you are flat to allow for your logic to "reset". This can be done in Strategy Actions.
              Josh P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by ErikY, Today, 11:12 AM
              0 responses
              1 view
              0 likes
              Last Post ErikY
              by ErikY
               
              Started by ericson, Today, 11:11 AM
              0 responses
              1 view
              0 likes
              Last Post ericson
              by ericson
               
              Started by Tradarr, Yesterday, 06:23 PM
              1 response
              19 views
              0 likes
              Last Post NinjaTrader_Jim  
              Started by Behungr101, Today, 10:17 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_JustinD  
              Started by ezrollin, Today, 10:11 AM
              3 responses
              11 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Working...
              X