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

Last Trade Data

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

    Last Trade Data

    Hi,

    I'm a bit new at NinjaScript so please forgive if this is a stupid question. (i do have some .NET programming experience)

    Is there any class/object providing info (entry price, exit price, profit/loss, time. etc. etc.) about specific trades?

    For example, unsing NinjaScripthow would I determine if the previous trade of the day was a winner or loser?

    I came across this requirement while trying to convert some of my EasyLanguage code to NinjaScript.

    Any response much appreciated.

    Regards,



    Jerry



    #2
    imported post

    >> Is there any class/object providing info (entry price, exit price, profit/loss, time. etc. etc.) about specific trades?

    You could try playing with a 1 tick series which holds all trades of the complete lookback period

    >> For example, unsing NinjaScripthow would I determine if the previous trade of the day was a winner or loser?

    StrategyBase.Performance.AllTrades is a collection of all trades of the strategy (pls serach docs for AllTrades).


    Comment


      #3
      imported post

      Thanks for the response.

      >>StrategyBase.Performance.AllTrades is a collection of all trades of the strategy (pls serach docs for AllTrades).


      Yes, but how does one reference individual trades in the collection and expose its properties?

      Comment


        #4
        imported post

        Sorry, indexed access it not supported at this time. This is "only" an enumerator.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by martin70, 03-24-2023, 04:58 AM
        15 responses
        114 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by The_Sec, Today, 02:29 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by jeronymite, 04-12-2024, 04:26 PM
        2 responses
        31 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by Mindset, 05-06-2023, 09:03 PM
        10 responses
        265 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by michi08, 10-05-2018, 09:31 AM
        5 responses
        743 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X