Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Flatten All Positions once Daily Profit Goal Achieved

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

    Flatten All Positions once Daily Profit Goal Achieved

    Good Morning Everyone. I would like to know if it is possible to create a way to automatically Flatten All Positions once my Daily/Session Profit Goal is Achieved. My biggest problem is NOT being able to stop while up. I continue to trade and give it all back. Sometimes, I don't even realize I have hit my Daily or Session Goal and trades that were going good suddenly reverse and again, I give it all back. I would much prefer my machine automatically flatten all of my positions once my desired Total Profit has been achieved. In this industry, you could simply sneeze and miss your exit.

    Anyone know if something like this is possible? Perhaps someone has already created such a thing?

    Any help would be greatly appreciated!

    Thanks,

    Bob

    #2
    So what you want is Ninjatrader or a 3rd party to flatten your positions? And then what? Lock your out of your brokerage account?
    What happens on days that you lose? Do you revenge trade? Over-leverage?

    You don't want the "tough love" that it takes to trade futures... And I would contend you don't have the discipline or proper mindset it takes to be successful long term... This is reality and I hope I am not the first person to tell you this... This is not a technology problem with a technology solution...

    This is a "Man in the mirror" problem... The internet is filled with trading psychologists who can help you understand the words GREED and FOMO because that is what you are suffering from...

    You have a LONG WAY to go to be a successful long-term trader rather than a statistic... I wish you well...

    Comment


      #3
      Wow Brent!!! I can't tell you how much I appreciate your 'Tough Love' Advice and explaining to me how I don't have what it takes!!! I am sure your insightful response comes from a well qualified background filled with a wealth of wisdom, success & experience, however...

      As I am sure that was an answer to some question, it was not an answer to mine...

      Whatever my logic and/or reasoning is, the question still remains; is there a way to create such a critter that will flatten all of my 'Current Positions' once I achieve my Daily and/or Session Profit Goal?

      Thanks in advance for any help!

      Bob

      Comment


        #4
        Google is your friend... TREMPER.com | Discipline Manager​ ...

        And yes, you got 5 figures of risk management and advice for free... You should be fine... Good luck.

        Comment


          #5
          Hello 6bobclose5,

          Thanks for your post.

          To clarify, are you looking for an existing strategy that closes all positions once a daily profit/loss limit is reached?

          Or, are you looking for insight to code your own custom strategy to close positions once a daily profit/loss limit is reached?

          I look forward to assisting further.
          Brandon H.NinjaTrader Customer Service

          Comment


            #6
            Thanks Brandon. Either way would be great!

            Comment


              #7
              Thanks again Brent.

              Comment


                #8
                Hello 6bobclose5,

                Thanks for your notes.

                I am not aware of an existing script that accomplishes this specific goal.

                You could try searching the Ecosystem User App Share for a possible solution.

                Ecosystem User App Share: https://ninjatraderecosystem.com/user-app-share/

                If you want to create your own custom NinjaScript strategy, you could use the CancelOrder() method to cancel an order when a daily loss limit or daily profit limit is reached. Or, the CloseStrategy() method could be used to cancel all working orders, close any existing positions, and finally disables the strategy.

                See the help guide documentation and reference sample linked below for more information.

                CancelOrder() reference sample: https://ninjatrader.com/support/help...thod_to_ca.htm
                CloseStrategy(): https://ninjatrader.com/support/help...sestrategy.htm

                You could find reference samples of implementing daily loss limit in a NinjaScript strategy here: https://ninjatrader.com/support/foru...limit-examples

                Similar logic would be used to implement a daily profit limit in the script.

                Below is a link to a forum post with helpful information about getting started with NinjaScript.
                https://ninjatrader.com/support/foru...040#post786040

                The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
                Brandon H.NinjaTrader Customer Service

                Comment


                  #9
                  Bruh.
                  brenthilburn this guy 6bobclose5 is trying to become a consistent trader and you spew that hater BS? People like you are disgusting. this guy asked a thoughtful question about closing all positions when he's up in position and i just cant believe you put him down like that.
                  6bobclose5 I became a profitable trader in this last year and I've only been trading for a year and a half. This guy shooting you down probably took like 5-6 years to become profitable and has major issues with his relationships.
                  YOU will be successful and you SHOULD do it in a year. Ask all the questions you want on this forum we here to help people with questions in the same manner we were helped when we have questions.
                  Anyways:
                  1.) To manage orders on a strategy or indicator you need to be coding in Ninjascript you don't need to be in a strategy.
                  2.) Create and Account object and in State.Configure set the find the account

                  - ACCOUNT = Account.All.FirstOrDefault (a => a.Name == "Playback101");

                  replace Playback101 with your account name or create a account convertor like:
                  [TypeConverter (typeof (NinjaTrader.NinjaScript.AccountNameConverter))]
                  [Display (Name = "Account Name", Description = "Selects The Account (from Ones Available)", Order = 1, GroupName = "Account Selector")]
                  public string AccountName { get; set; }​


                  Finally always check that its not null before you use it with Account != null and here's how you can FLATTEN ALL POSITIONS:
                  if (CONDITION)
                  {ACCOUNT.Flatten (new[] { Instrument });}
                  Explore other functionality with ACCOUNT. and be surer to use arrays[]
                  LASTLY:

                  - Ask ChatGPT, luckily we have A.I. and don't have to deal with hateful losers trying to push us down for growing so that will be your best friend, and 99% of the time this forum is useful.
                  Finally,
                  Someone should ban that guy brenthilburn
                  ​ for telling someone to quit, that's just unbelievable bro.
                  Dont watch YouTube, and don't listen to guys like him, NOW GET PRACTICING AND PUT HIS A$$ IN HIS PLACE
                  Last edited by Entwaze; 07-02-2023, 08:11 PM.

                  Comment


                    #10
                    Originally posted by Entwaze View Post
                    Bruh.

                    Finally,
                    Someone should ban that guy brenthilburn
                    ​ for telling someone to quit, that's just unbelievable bro.
                    Dont watch YouTube, and don't listen to guys like him, NOW GET PRACTICING AND PUT HIS A$$ IN HIS PLACE
                    There we go bro... we always get to the real crux of the matter... I don't like what I see on the Internet so it should just be banned... You are incapable of adulting in an adult world where opinions not your own just don't need to see the light of day...

                    There's a distinct line between trading and gambling... The inability to stop on your own and walk away from a successful trading day and quote "give it all back" is the hallmark swan-song of a gambler... Professionals or those who want to trade for income know this very well... They also know when it's NOT their day and they are capable of losing in the same manner...

                    Any technology employed to save you from yourself can just be turned off... And will NEVER solve the problem...

                    And last I checked this is a PUBLIC forum... That means anyone can respond and it's up to the one asking for advice to decide if it's useful and that wasn't you... Someone else may come along and get something useful out of this post even if YOU didn't...
                    Last edited by brenthilburn; 07-03-2023, 03:41 AM.

                    Comment


                      #11
                      I hear you man, but trading is tough enough without having people tell you to stop.
                      Ive had so many people tell me it wasn't possible and i fed off it even though i sacrificed all my time to become profitable.

                      No matter how good you are at trading you still get that adrenaline rush, no matter how professional, or at what level. Goldman Sachs, Bloomberg, all these traders are gonna get it.

                      I saw a pretty decent video from guy UMAR ASHRAF that started TRADEZELLA which keeps track of trades.
                      He does Millions per year in Profits but also has huge losss
                      He said personally one of his biggest problems even after 8 years of trading was coming back to the desk top and trading even when he said he wasn't going to and man this **** happens to me to .

                      I don't think its a small problem. Ill make 10K and then come back because now my risk Appetite has gone up,
                      but this has nothing to do with my automated evolving networks which automatically trade, its a matter or trying to take it to the next level.

                      Comment


                        #12
                        No, I think what brenthilburn is trying to do here is provide a wake-up call and some real world advice from someone who has been there that there are real issues that have to be faced personally to be successful. The greatest difficulties in trading are not technological e.g. "if only my strategy had this one more feature" or "if only NinjaTrader would let me have trend lines that blink and supported a refresh rate of 120hz" or some craziness like that but psychological.
                        Bruce DeVault
                        QuantKey Trading Vendor Services
                        NinjaTrader Ecosystem Vendor - QuantKey

                        Comment


                          #13
                          And to the original question, although I don't have an immediate solution at hand and this isn't my area of specialty, if what you want is some automation that closes out all your positions when you reach some daily profit goal, I'm highly confident that could be programmed. I'm not saying that's any sort of silver bullet, but if that is what you want, I am sure you can have it - just get on the EcoSystem website and search for "programmer" or "programming" or "developer" or "development" and pick someone to help you if you need or want help.
                          Bruce DeVault
                          QuantKey Trading Vendor Services
                          NinjaTrader Ecosystem Vendor - QuantKey

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by rhyminkevin, Today, 04:58 PM
                          3 responses
                          47 views
                          0 likes
                          Last Post Anfedport  
                          Started by iceman2018, Today, 05:07 PM
                          0 responses
                          5 views
                          0 likes
                          Last Post iceman2018  
                          Started by lightsun47, Today, 03:51 PM
                          0 responses
                          7 views
                          0 likes
                          Last Post lightsun47  
                          Started by 00nevest, Today, 02:27 PM
                          1 response
                          14 views
                          0 likes
                          Last Post 00nevest  
                          Started by futtrader, 04-21-2024, 01:50 AM
                          4 responses
                          50 views
                          0 likes
                          Last Post futtrader  
                          Working...
                          X