Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print Last trade problem

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

    Print Last trade problem


    Hello, I would like to obtain the profit or the stop in currency of the last trade, but I think that my input method does not allow the usual method to be used (systemperformance, alltrades.count always gives 0, does not add trades)


    my input method is as follows

    entryOrderShort = account.CreateOrder(Cbi.Instrument.GetInstrument(i nstrumentCC), OrderAction.Sell, OrderType.Market, TimeInForce.Day, Contracts, 0, 0, string.Empty, "Entry", null);
    NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy(ATMTemplate, entryOrderShort);


    I think that obtaining the ATMstrategyID could obtain that information, but since it is not invoked in a common way, I do not know how to obtain that ID


    I hope you can help me find a way to print the information of the last trade once it has been closed

    #2
    Hello RubenCazorla,

    You are using the Addon framework ATM submission so there would be no performance information tied to that. You would need to use the regular tools in the platform to view performance, that is submitting the order similar to a manual tool like the chart trader. For a script to see trade performance you would need to be using a Strategy and use the Managed or Unmanaged framework.



    There is also a strategy based ATM framework however the items like system performance do not work with that, you would need to use the strategy specific methods to query the ATM.


    You can see the sample strategy SampleATMStrategy that comes with the platform for an example of how to use ATM's in a strategy.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X