Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Logic for creating a runner in Ninjascript

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

    Logic for creating a runner in Ninjascript

    Hello

    I'm a new user of ninjatrader and I've been working with the Strategy Builder but think I hit my limit. I have been able to create all of the rules for entry, however, struggling to find a way to create a runner. So for example If I start with 10 contracts and I want 5 to be sold at target 1 and the other 5 to run and have a trailing stop behind it by XX ticks (based on a users input)

    I understand this can't be done in strategy builder but can be in the code. I have no idea what to look for and don't see many articles on how to code for it.

    Any help would be greatly appreciated.

    Thanks,
    Tony

    #2
    Hello nqfundedtrader,

    Thanks for your post.

    You can use Exit order methods and add coding logic in the Strategy Builder to accomplish this goal. Please note that you would not be able to use the Exit methods and the Set methods in the Stop and Targets window as that creates a violation of the managed approach internal order handling rules, linked here: https://ninjatrader.com/support/help...d_approach.htm

    My colleague Chelsea has created educational examples of Strategy Builder breakeven and trailing stop in the Strategy Builder here:
    https://ninjatrader.com/support/foru...der#post806596

    Scaling into a position is controlled by the signal names of your strategy, and properties EntryHandling and EntriesPerDirection. This reference sample can help with scaling in and out of a strategy.
    https://ninjatrader.com/support/helpGuides/nt8/en-us/scaling_out_of_a_position.htm

    This sample can assist further with managing multiple exit/entry signals:
    https://ninjatrader.com/support/helpGuides/nt8/en-us/using_multiple_entry_exit_sign.htm

    Please let us know if we may assist further.​
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Thanks. I'm confused how I go about organizing this. Are there any coded examples I can look at somewhere? Sorry if I am asking basic questions, I'm new to this and trying to learn. Thanks again

      Comment


        #4
        Hello nqfundedtrader,

        Thanks for your note.

        In post # 2 you could find links to example scripts demonstrating these concepts. It would ultimately be up to you to come up with the exact logic to suit your goals.

        You could find an example of trailing stop in the Strategy Builder in this forum thread: https://ninjatrader.com/support/foru...der#post806596

        This reference sample can help with scaling in and out of a strategy.
        https://ninjatrader.com/support/helpGuides/nt8/en-us/scaling_out_of_a_position.htm

        This sample can assist further with managing multiple exit/entry signals:
        https://ninjatrader.com/support/helpGuides/nt8/en-us/using_multiple_entry_exit_sign.htm

        I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript:
        https://ninjatrader.com/support/help..._resources.htm

        Let me know if I may further assist.​
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Thanks Brandon. I downloaded the file and the imported them but how do I actually see what's in the files after I imported them? Is it an indicator that I look at??? It also said when I loaded that this was out of date to what I had. I went ahead and loaded them anyway. Hopefully that was ok to do

          Comment


            #6
            Hello nqfundedtrader,

            Thanks for your note.

            These example scripts are NinjaScritpt strategies. To view a NinjaScript strategy, open a New > NinjaScript Editor window, open the Strategies folder, and double-click on the strategy file to view it.

            Here is a link to our publicly available training videos, 'Strategy Builder 301' and 'NinjaScript Editor 401', for you to view at your own convenience.

            Strategy Builder 301 — https://www.youtube.com/watch?v=_KQF2Sv27oE&t=13s

            NinjaScript Editor 401 - https://youtu.be/H7aDpWoWUQs?list=PL...We0Nf&index=14

            I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript:
            https://ninjatrader.com/support/help..._resources.htm

            If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our help guide first:
            https://ninjatrader.com/support/help...g_concepts.htm

            Let me know if I may assist further.
            Brandon H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by kempotrader, Today, 08:56 AM
            0 responses
            1 view
            0 likes
            Last Post kempotrader  
            Started by kempotrader, Today, 08:54 AM
            0 responses
            2 views
            0 likes
            Last Post kempotrader  
            Started by mmenigma, Today, 08:54 AM
            0 responses
            1 view
            0 likes
            Last Post mmenigma  
            Started by halgo_boulder, Today, 08:44 AM
            0 responses
            1 view
            0 likes
            Last Post halgo_boulder  
            Started by drewski1980, Today, 08:24 AM
            0 responses
            3 views
            0 likes
            Last Post drewski1980  
            Working...
            X