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

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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by giulyko00, 04-24-2024, 12:03 PM
    7 responses
    32 views
    0 likes
    Last Post eDanny
    by eDanny
     
    Started by NM_eFe, Today, 10:13 AM
    0 responses
    4 views
    0 likes
    Last Post NM_eFe
    by NM_eFe
     
    Started by hdge4u, Yesterday, 12:23 PM
    1 response
    10 views
    0 likes
    Last Post hdge4u
    by hdge4u
     
    Started by 1001111, Today, 09:45 AM
    0 responses
    12 views
    0 likes
    Last Post 1001111
    by 1001111
     
    Started by DTSSTS, 01-28-2024, 12:07 PM
    11 responses
    561 views
    0 likes
    Last Post bmo111
    by bmo111
     
    Working...
    X