Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Target profits

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

    #46
    Hello Pladjiske,

    Thank you for your reply.

    What is the full text of the error you receive?

    If you turn on the trace orders function (TraceOrders == True in State == State.SetDefaults) do you see the ExitLong being submitted, or does it error prior to submitting?

    Thanks in advance; I look forward to assisting you further.

    Comment


      #47
      Hello Kate,

      Many thanks for your answer. I hope you and your loved ones are safe and healthy.
      I solved it by restarting Ninjatrader. So I think I had performed to many different backtests.

      I wanted to know: On your website the margin fot the YM states:E-MINI DOW JONES INDEX Intraday Margin: 500 Initial Margin: 13200 Maintenance margin:12000
      What does it mean? How many futures can I buy when I have 100.000 USD in my account?
      And how many can I hold till the next day?

      Kind regards,
      Ladis

      Comment


        #48
        Hello Pladijske,

        Thank you for your reply.

        That would be a question for our Brokerage Support team - the forums here are primarily technical support focused and our brokerage staff isn't on here. You can reach them via email at brokeragesupport [at] ninjatrader [dot] com. They'd be happy to explain margin requirements to you.

        Please let us know if we may be of further assistance to you.

        Comment


          #49
          Hello Kate,

          I contacted the brokerage and everything is ok. Thank you very much.
          I have another question:
          When I perform a backtest on a strategy, I can see how long (#candles) the trade has taken to complete.
          Is there also a way to see how much my "account" has gone down before the target is reached?
          I don't mean the maximum drawdawn, because that is something else.
          I mean: When I buy 1 YM at 10.000 and my target is 10.010. But before that is reached the YM first goes to 9450 and then back up to my target sell price.
          Can I see that amount (10.000 - 9450= 550) somewhere?
          Many thanks!
          Last edited by Pladijske; 04-18-2020, 07:52 AM.

          Comment


            #50
            Hello Kate,

            Could you perhaps help me with the following:
            I have a portfolio of 100.000 USD. In the backtest of my strategy I want to buy X number of futures depending on the value of the underlying index.
            What I mean is that I can buy more YM's when the DOW is at 10.000 points then I can buy today when the dow is at 23.000.
            So when I now buy 10 YM at 23000 I can buy (10x23000)/10.000 YM when the value was 10.000=23 YMS.
            But when the the YM was 9500 this gives 10x23000/9500 = 24.21
            How can I code this to give the best corresponding value -> 24
            UNfortunately I don't know the exact word to say it in English.

            Many thanks!

            Comment


              #51
              Hello Pladijske,

              I think in this case you'd want to use Math.Truncate() on the result:



              Since you're always going to want this to be rounded down, you don't really need the decimals at all, you only care about the whole number amount you can buy. If you use Math.Truncate() it will strip off the decimal and leave you with the whole number.

              Please let us know if we may be of further assistance to you.

              Comment


                #52
                Hello Kate,

                Thank you very much.
                I have another question:
                When I perform a backtest on a strategy, I can see how long (#candles) the trade has taken to complete.
                Is there also a way to see how much my "account" has gone down before the target is reached?
                I don't mean the maximum drawdawn, because that seems to be something else, because it can go down 500 points and I have 4 futs and then the max DD is 1240 USD, so that's not the number I need.
                I mean: When I buy 1 YM at 10.000 and my target is 10.010. But before that is reached the YM first goes to 9450 and then back up to my target sell price.
                Can I see that amount (10.000 - 9450= 550) somewhere?
                Many thanks!

                Comment


                  #53
                  Hello Pladijske,

                  Thank you for your reply.

                  It sounds like what you are looking for is the MAE or Maximum Adverse Excursion for the trade. You can find this value in the Trade Performance window in the Trades view.

                  MAE (max. adverse excursion) is defined as worst price trade reached – entry price.

                  Here's a link to our help guide on Average MAE that touches on how MAE is calculated:



                  It's worth noting that with trades that you've scaled into and out of, it would be expected that the MFE, or Maximum Favorable Excursion, would be the same for all exits. This is expected and is a limitation of NinjaTrader.

                  Please let us know if we may be of further assistance to you.

                  Comment


                    #54
                    Dear Kate,

                    I bought the lifetime version. I wanted to ask: in the Tools menu you can select "trading hours" and then add "holidays".
                    When I add dates in this template and run a real time strategy, does the strategy exclude these days?
                    What about backtests?
                    What is the right corresponding template for the YM future?
                    Many thanks,
                    Pladijske

                    Comment


                      #55
                      Hello Pladijske,

                      Thank you for your reply.

                      Yes, if you add a holiday in the trading hours template, that holiday will be excluded from the strategy and no trades will be taken on that date. Same with backtests.

                      The YM uses the CME US Index Futures ETH template by default. If you are using the YM with your strategy, you can leave the strategy Trading Hours set to Use Instrument Default to use that trading hours template (which has holidays built into it) for the strategy.

                      Please let us know if we may be of further assistance to you.

                      Comment


                        #56
                        Dear Kate,

                        Many thanks for your reply.
                        So when I select the CME US Index Futures ETH template for the YM and then I add some extra dates (when I am on holiday or so) there will be no trading on these days by the strategy or backtest?

                        Comment


                          #57
                          I have another question.
                          When , in my strategy, I want an alert "play sound" with a .wav file that I recorded myself I added:

                          PlaySound(@"D:\OneDrive\BEURS\2020\NinjaTrader\ala rm dax long signaal 1.wav");Is this correct?
                          Is there a possibility the set that sound "repititive" until I stop it?

                          Again: Many thanks to answer these 2 questions (this one and the one above this reply.

                          Comment


                            #58
                            Hello Pladijske,

                            Thank you for your reply.

                            Yes, if you add the dates as holidays, the strategy will ignore those dates.

                            Yes, that looks correct as far as the structure for PlaySound(). The sound will only play one time, there is not an option to play the sound until you stop it.

                            A continuous sound that plays until manually reset would require custom coding to be added to your NinjaTrader. The coding would require the condition to be defined that starts the sound and then monitors a reset mechanism (such as a pop-up window with an acknowledge button) to then reset the sound and alarm condition. I am not aware of any existing indicator or strategy that would provide this.

                            Please let us know if we may be of further assistance to you.

                            Comment


                              #59
                              Ok thank you very much!

                              Comment


                                #60
                                Dear Kate,

                                Is there a way in Sendmail() to add the @INSTRUMENT and the @PERIOD as you can do in the in chart alerts?

                                Kind regards,
                                Ladis

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by NullPointStrategies, Yesterday, 05:17 AM
                                0 responses
                                62 views
                                0 likes
                                Last Post NullPointStrategies  
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                134 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                75 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                45 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                50 views
                                0 likes
                                Last Post TheRealMorford  
                                Working...
                                X