Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATM in ninja script strategy

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

    #91
    How to get the realized profit of each strategy? Not each position.

    Comment


      #92
      Hello,

      Realized profit is here if your not using ATM Strategies:



      Or, if your using ATM Strategies you would need create a counter variable and as soon as you exit the trade add to this variable as there is no method to pull all trade information from the strategy to get a mseter PnL since it doesnt exist as above since yor overriding it by using ATM Strategies. Such as the below example.



      Let me know if I can be of further assistance.
      Last edited by NinjaTrader_Brett; 01-25-2011, 07:23 AM.
      BrettNinjaTrader Product Management

      Comment


        #93
        Please help me on this:

        How to put a counter variable for a dataseries so that it will not backfield the last bar for example in the last bar I set it to green and then in the current bar it will be white and in the next bar it will be green again. Now, sometimes the white color will be backfield by a green color.

        if(ema34slope>=angle2)
        {
        EMAslopeup.Set(1,SmoothEMAV2(Fast,Period,Slow)[1]);
        EMAslopeup.Set(SmoothEMAV2(Fast,Period,Slow)[0]);
        colorVal=1;
        ema34slopeValue.Set(colorVal);
        }
        else if (ema34slope>=angle1)
        {
        EMAup.Set(1,SmoothEMAV2(Fast,Period,Slow)[1]);
        EMAup.Set(SmoothEMAV2(Fast,Period,Slow)[0]);
        colorVal=1;
        ema34slopeValue.Set(colorVal);
        }
        else
        {
        EMAflat.Set(1,SmoothEMAV2(Fast,Period,Slow)[1]);
        EMAflat.Set(SmoothEMAV2(Fast,Period,Slow)[0]);
        colorVal=1;
        ema34slopeValue.Set(colorVal);
        }

        Please!!!

        Comment


          #94
          Hello,

          First are you on NinjaTrader 6.5 or NinjaTrader 7?

          I look forward to assisting you further.
          BrettNinjaTrader Product Management

          Comment


            #95
            I am using NT7, by the way how to get the realized profit of all running strategies at that day not the individual? If have 3 strategies running then I want to get the realized profit of all of them. And also, hot to move the stop to market price not the close,low or high price?Thanks in advance.

            Comment


              #96
              How to set a font to bold? For example,
              textFont2 = new Font("Eras Demi ITC",10);

              I want that to be bold. The syntax for font style what I mean. Thanks in advance.

              Comment


                #97
                Hello,

                There would only be a way to get profit and loss of the current strategy. There is no way to get all strategies PnL. To get all strategies profit and loss you would need to put all the strategies into one multi series strategy.



                As far as the font, this would need to be set when you create the font object.

                This is more general c#.

                BrettNinjaTrader Product Management

                Comment


                  #98
                  How to get the numbers of ticks of each bar? So that if it reaches a certain number of ticks then I will trigger the entry. Show me some example. And also I have a problem in plotting a value, I want it to be plotted in the same direction with the bar. For example, if in this bar the number is 5 then I want it be plotted in the same direction with the price if it is goes up or down without changing the value which is 5. Give me a sample code please.

                  Comment


                    #99
                    Hello,

                    You would use the following:



                    As far as your second question not sure what yor trying to do here, would need further clarification on what your trying to do.
                    BrettNinjaTrader Product Management

                    Comment


                      Originally posted by NinjaTrader_Brett View Post
                      Hello,

                      You would use the following:



                      As far as your second question not sure what yor trying to do here, would need further clarification on what your trying to do.
                      I have attached a sample image of what I mean to say about the plotting indicator in the chart. Like for example in the image, the line is red and the value is 14.04,. It looks like a plot of a moving average but the value is less than the displayed prices in right panel. How to plot like that? Even do the value is 14.04 but it is plotted near to 88.90. Help please?
                      Attached Files

                      Comment


                        Hello,

                        The only way to do this is to program an indicator that appears in the bottom price panel as normal. Then drag that indicator up into the main price panel so that it has its own scale. This would be the only way to do this.

                        A Chart has 3 scale justifications. Right, Left, and Overlay.

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

                        Comment


                          AtmStrategyCreate() clarification

                          I want to make sure that I understand the AtmStrategyCreate() method.

                          Under Method Return Value:
                          "Returns true if the specified ATM strategy was found; otherwise false. True in NO WAY indicates that the strategy in fact has been closed. It indicates that the the specified ATMstrategy was found and the internal close routine was triggered." I have paid particular attention to the last sentence.

                          Let's say I have an ATM strategy template called MyATM already running. I get a new signal and I want to create a new ATM strategy template called MyATM. It makes no difference if I want to go long or short. Now when I issue the AtmStrategyCreate() with a strategyTemplateName of MyATM I expect the following to happen:

                          1: for the current running ATM strategy template -MyATM, NT cancels any working orders and closes any open position of a strategy by first modifying any existing target orders so they are filled or submitting a market order if no target orders exist.
                          2: NT creates a new ATM strategy using the ATM strategy template MyATM.

                          So effectively I have done a 'Auto Reverse'.

                          Or am I required to 1st issue an AtmStrategyClose() and then issue the AtmStrategyCreate().

                          Thanks.

                          Comment


                            scjohn, you will first have to close the current strategy and then create the new one.
                            AustinNinjaTrader Customer Service

                            Comment


                              Ok. Then I think that the documentation should be changed.

                              Comment


                                Hello,

                                There will be no documentation change. As this is working as expected.

                                As if you dont issue an ATMStrategyClose() the current ATM Strategy that is instanced out will continue to run and you will open a second ATMStrategy that has its own PT and SL's. Effectively allowing you to go long and short the same market at the same time. This is intended design.

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

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                649 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                370 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                109 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                573 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                576 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X