Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Capturing NT trade signals

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

    Capturing NT trade signals

    I am an experienced programmer and have a problem I need to solve. Looking around on the forum its looks like many people have been interested in a similar problem. The problem is how best to get executions out of an NT strategy to be used elsewhere? I can do this from within a strategy, as many people have posted solutions to this. I need to be able to grab executions outside of a strategy, where I do not have access to the strategy code itself. The reason is that I need to notify myself of strategy execution events for strategies I am leasing from other developers. In this case I don't want to bother the developers to change their code, I want to simply capture the execution events.

    I have found the file Executions.txt and also the log files. You will see log entries like (I replaced all sensitive numbers with xxxx):

    0/28/2011 10:53:54 AM|1|64|Instrument='TF 12-11' Account='Uxxxxxx' Avg price=760.8201 Quantity=1 Market position=Long Operation=Insert Currency=UsDollar
    10/28/2011 11:29:49 AM|1|32|Order='xxxxxxx!Vision!OptimusFutures' Name='Buy' New state=PendingSubmit Instrument='6E 12-11' Action=Buy Limit price=0 Stop price=0 Quantity=2 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
    10/28/2011 11:29:49 AM|1|32|Order='xxxxxxxxx!Vision!OptimusFutures' Name='Buy' New state=Accepted Instrument='6E 12-11' Action=Buy Limit price=0 Stop price=0 Quantity=2 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
    10/28/2011 11:29:49 AM|1|32|Order='xxxxxxx!Vision!OptimusFutures' Name='Buy' New state=Working Instrument='6E 12-11' Action=Buy Limit price=0 Stop price=0 Quantity=2 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
    10/28/2011 11:29:49 AM|1|32|Order='xxxxxxxx!Vision!OptimusFutures' Name='Buy' New state=PartFilled Instrument='6E 12-11' Action=Buy Limit price=0 Stop price=0 Quantity=2 Type=Market Filled=1 Fill price=1.4163 Error=NoError Native error=''
    10/28/2011 11:29:49 AM|1|16|Execution='xxxxxx:xxxxxxxxx|xxxxxxxxx' Instrument='6E 12-11' Account='xxxxxx!Vision!OptimusFutures' Exchange=Globex Price=1.4163 Quantity=1 Market position=Long Operation=Insert Order='xxxxxxx' Time='10/28/2011 11:29:49 AM'

    Given the above, I plan on the following:
    1) Create an indicator that can be inserted into the same chart as the strategy.
    2) The indicator will therefore have knowledge of the instrument and the account that the strategy is running on through NT calls.
    3) The indicator will access the log files whenever they change, and search for "Execution" lines where the "Instrument" matches and the "Account" matches.
    4) The indicator will only use new executions, so it will have a date/time of the last execution it found and move forward from there.
    5) The indicator will then do something to export the execution information to an external program. In my case I'll be writing the trade data to a mysql database.

    The question for NT is, knowing that this is all unsupported, is there any better suggestion or idea for this development?
    Last edited by tradetree; 10-29-2011, 08:27 AM.

    #2
    tradetree,

    I am happy to assist you.

    Your method seems reasonable. I understand that you probably have seen these before, however to be sure we have some helpful reference samples on using StreamWriter/StreamReader, please find them below.





    The only issues I see that may occur is if you run more than one strategy on the same instrument and timeframe. You can fix this by opening multiple accounts perhaps.

    Its a fairly simple task to have automated strategies report their trades to log files, and as such perhaps asking the developer to implement it wouldn't be too unreasonable.

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Thanks. I think it makes sense to ask developers to dump the output of trades to a file. This is a bit of a kludge otherwise. I can ask them to either create a csv file like what is done manually in NT, or else give them code to add to the strategy.

      Comment


        #4
        tradetree,

        No problem.

        You can even give them both of those reference sample links and they should be able to report trades easy. It would probably only require approximately 1 hour work to get the strategies reporting as CSV files have very simple formatting.

        Please let me know if I may assist further.
        Adam P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X