Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Here's a basic template containing break even and trail

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

    Here's a basic template containing break even and trail

    Hey,
    I want to start by saying I'm not a programmer, so this is probably not the most effective / efficient way to manage trails and breakeven stuff. I have, however, beat my head against the wall trying to make it work using little snippets that I've found here. So here is my paltry contribution to the forum.

    This strategy was built to be a template for optimization. It has a framework that allows you to enable/disable long/short trades, second contract, breakeven, trail, and session time. It allows entry for stop loss, 2 profit targets, breakeven trigger, breakeven plus ticks, along with trail trigger and stop. That all means that it is also built to be optimized.

    Just to have something in place for you to replace, I used the "Golden Cross" strategy, running it on an NQ 1 minute chart. Replace the strategy specific code with your strategy...

    Again, the pros here will probably think this is sub-par, but it works...

    Also, thank you to all of the other comments that lead to this being built, I read too much to know who to credit individually.

    Hopefully this helps, please modify and improve it, all I ask is that you share it back to everyone.
    Attached Files
    Last edited by WynneIndustries; 02-26-2025, 11:55 PM. Reason: Removed the compiled script and replaced with cs file to comply with rules.

    #2
    This looks really terrific, but I can't figure out where the source code is to change so I can insert my strategy. Can you help me? I see the dll file and a very small GC_Template file in NT8/But the GC_Template file has only the Declarations in it. Thanks for any help you can give - it looks exactly like what I am looking for!

    Comment


      #3
      Originally posted by WynneIndustries View Post
      Hey,
      I want to start by saying I'm not a programmer, so this is probably not the most effective / efficient way to manage trails and breakeven stuff. I have, however, beat my head against the wall trying to make it work using little snippets that I've found here. So here is my paltry contribution to the forum.

      This strategy was built to be a template for optimization. It has a framework that allows you to enable/disable long/short trades, second contract, breakeven, trail, and session time. It allows entry for stop loss, 2 profit targets, breakeven trigger, breakeven plus ticks, along with trail trigger and stop. That all means that it is also built to be optimized.

      Just to have something in place for you to replace, I used the "Golden Cross" strategy, running it on an NQ 1 minute chart. Replace the strategy specific code with your strategy...

      Again, the pros here will probably think this is sub-par, but it works...

      Also, thank you to all of the other comments that lead to this being built, I read too much to know who to credit individually.

      Hopefully this helps, please modify and improve it, all I ask is that you share it back to everyone.
      WynneIndustries,

      Please know that only open source codes are allowed on NinjaTrader for sharing. Your posted strategy is a DLL file that is considered not safe and is not allowed. Quite sure that NT will remove your posted files.

      Recommend to replace your zip file to include an open source .sc file instead.

      Cheers!

      Comment


        #4
        Originally posted by cpabiz20k View Post
        This looks really terrific, but I can't figure out where the source code is to change so I can insert my strategy. Can you help me? I see the dll file and a very small GC_Template file in NT8/But the GC_Template file has only the Declarations in it. Thanks for any help you can give - it looks exactly like what I am looking for!
        It should have imported as a strategy that you can modify, but I will edit the original post with just the ninjascript file. I will also write up a little blurb about how to replace the code in it!

        Comment


          #5
          Originally posted by aligator View Post

          WynneIndustries,

          Please know that only open source codes are allowed on NinjaTrader for sharing. Your posted strategy is a DLL file that is considered not safe and is not allowed. Quite sure that NT will remove your posted files.

          Recommend to replace your zip file to include an open source .sc file instead.

          Cheers!
          Appreciate the heads up! I'll update the original post.

          Comment


            #6
            Originally posted by cpabiz20k View Post
            This looks really terrific, but I can't figure out where the source code is to change so I can insert my strategy. Can you help me? I see the dll file and a very small GC_Template file in NT8/But the GC_Template file has only the Declarations in it. Thanks for any help you can give - it looks exactly like what I am looking for!
            I replaced the zip with a cs file. Let me know if the attached file is what you were thinking, please.
            Attached Files

            Comment


              #7
              That is MUCH better - thank you !!!

              Comment


                #8
                This is excellent code - very easy to follow. Now if I can just find a winning strategy

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Today, 05:17 AM
                0 responses
                50 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                127 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                69 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                42 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                46 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X