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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    58 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    133 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X