Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Auto Strategy not traking profit/losses

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

    Auto Strategy not traking profit/losses

    I am working or writing a strategy and I am using the SampleAtmStrategy as a baseline. I notice it is not showing execution markers and the strategy is not keeping track of performance. Does a strategy with an ATM not have the ability to keep track of the Pnl since it was handed off to an ATM? Is there a way around this? I would like to monitor the strategy/ATM on a continual basis as still have the ability to move stops/targets as the positon develops.
    The only other way I handle generate a report of the ATM template. Also the template shows that it has a print statement? but where is it printing to? I would like to see per traded performance show in a box either on the chart or in separate window. It's not in the chart or data box.

    #2
    Hello jngrim,
    Thanks for your post.

    You cannot see the PnL on the same chart. If you open the SuperDom or another chart with the chart trader enabled then are you able to view the PnL.


    If you are trying to track the PnL via NinjaScript then unfortunately the Atm strategy wont return the PnL values using the Performance class etc. However you can use the GetAtmStrategyUnrealizedProfitLoss or GetAtmStrategyRealizedProfitLoss to retrieve the PnL values. Please refer to our help guide to know more about it.

    Are you referring to the Print function. If so then the values will be printed out in the Output Window (Tools>Output Window, in the Control Center).
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      What about the entry and exit markers? hy are they not displaying..It it not turned off in the data series.
      Please advise.

      Comment


        #4
        Hello jngrim,
        Unfortunately orders submitted by Atm strategy wont display the plot executions.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          The Unrealized profit is already in the ATM I think

          if (atmStrategyId.Length > 0)
          {
          // You can change the stop price
          if (GetAtmStrategyMarketPosition(atmStrategyId) != MarketPosition.Flat)
          AtmStrategyChangeStopTarget(0, Low[0] - 3 * TickSize, "STOP1", atmStrategyId);

          // Print some information about the strategy to the output window
          Print("The current ATM Strategy market position is: " + GetAtmStrategyMarketPosition(atmStrategyId));
          Print("The current ATM Strategy position quantity is: " + GetAtmStrategyPositionQuantity(atmStrategyId));
          Print("The current ATM Strategy average price is: " + GetAtmStrategyPositionAveragePrice(atmStrategyId)) ;
          Print("The current ATM Strategy Unrealized PnL is: " + GetAtmStrategyUnrealizedProfitLoss(atmStrategyId)) ;

          So I'm lost too

          Comment


            #6
            Hello Shadowshorter,
            Welcome to the forum and I am happy to assist you.

            Yes, you can use the GetAtmStrategyUnrealizedProfitLoss method to get the unrealized PnL. Please refer to our help guide to know more about it.


            To assist you further may I know what exact scenario you are facing.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              I still don't understand how to add my entry conditions into the SampleATMStrategy?
              I've looked at this and can't get it to work.

              Comment


                #8
                Hello Shadowshorter,
                Are you trying to submit/create a new entry order using the Atm methods? If so then you can do so via the AtmStrategyCreate method.

                Please refer to our help guide to know more about it.
                JoydeepNinjaTrader Customer Service

                Comment


                  #9
                  Hi,

                  I've done that but no entries are created.

                  Comment


                    #10
                    Hello Shadowshorter,
                    To assist you further can you please send a toy NinjaScript code* replicating the behavior to support[AT]ninjatrader[DOT]com

                    Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.

                    I look forward to assisting you further.

                    *The "toy" just means something that is a stripped down version that isn't necessarily the whole logic. It makes things easier to rout out.
                    JoydeepNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by funk10101, Today, 09:43 PM
                    0 responses
                    3 views
                    0 likes
                    Last Post funk10101  
                    Started by pkefal, 04-11-2024, 07:39 AM
                    11 responses
                    36 views
                    0 likes
                    Last Post jeronymite  
                    Started by bill2023, Yesterday, 08:51 AM
                    8 responses
                    44 views
                    0 likes
                    Last Post bill2023  
                    Started by yertle, Today, 08:38 AM
                    6 responses
                    26 views
                    0 likes
                    Last Post ryjoga
                    by ryjoga
                     
                    Started by algospoke, Yesterday, 06:40 PM
                    2 responses
                    24 views
                    0 likes
                    Last Post algospoke  
                    Working...
                    X