Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

keep and analyse historical trades inside a strategy logic

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

    keep and analyse historical trades inside a strategy logic

    as I am not very experienced in programing, wanted to consult about which path to choose.

    Asume I have a strategy that runs and does its thing intraday.At the end of day all positions are closed.
    when it runs is has successful trades that reach target and also trades that end up with a stoploss
    it also looks for some price patterns and acts upon them.
    so I have various counters that count the patterns and how the strategy behaved

    I would like to add some logic that will be based on previous days' trades. For example a week worth of trades.
    So I assume I need to include some mechanism that will keep the historical results in some sort of list/dictionary etc. so it can be accessed in real time and analysed for trade decisions.

    I am looking for advice about how to approach this.

    I dont think I need to export the data into some external text file or excel . But maybe this can be a better idea ? and I can keep the files outside the strategy to look for some statistics of my own afterwards.

    So what are the basic options / directions I can go to? What do other people use in such a case?

    Thanks

    #2
    Hello dadarara,

    Thank you for the post.

    In NinjaTrader 8 you may use the Account class to retrieve account information. The Account object includes a collection of Orders and Executions on the account the strategy is running on.

    Each order in the Orders collection contains a "FromEntrySignal" property. If your strategy applies entry signals to each of the orders that it makes, you can use the FromEntrySignal property to identify only the trades that the strategy made.

    Below is a link to the help guide on the Account class.



    Creating your own CSV file is an option as well. Below is a public like to Microsoft's SteamWriter example. You can do the same thing in NinjaScript:


    Please let me know if I can assist further.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X