Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Write to a file from indicator

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

    Write to a file from indicator

    Hello,
    I have a custom indicator that write to an output file - Myout.txt. I followed the guidelines as in the documentation.
    I use this custom indicator in market analyzer.
    I get an error "Error on calling 'Onbarupdate' method on bar 72: the process cannot access the file Myout.txt because it is used by another process".
    Since the file is not opened in another editor , could the problem be due to market analyzer calling various instruments that are trying to update the file ?


    Any suggestions on how I can get this to work ?
    basically, what I want is when an instrument called by market analyzer , reaches a certain position I will be able to record it in a Log file.
    Thanks,
    Lior

    #2
    Hello Leope,

    Yes, that is very likely the case that the analyzer being used is causing the problem due to more instruments trying to write at once. If instrument A is writing data while instrument B tried to also write data, it could not.

    Does the output need to specifically be in one file? If not, a simple solution would likely be to make individual files so only one instrument can access the file at once.


    I look forward to being of further assistance.

    Comment


      #3
      Hello Jesse,
      Thanks for your answer. I will separate it a few files.
      One thing I am not clear is - doesn't the market analyzer "call" the instruments from the list in a serial manner (one after the other) ?
      If so , how can this kind of situation occur ?
      Thanks,
      Lior

      Comment


        #4
        Hello Leope,

        In the Market Analyzer, because this tool is driven by market data each indicator would be called once a new tick is received for the instrument it is applied to. If you are using CalculateOnBarClose = true then they would still be called once each series closes a bar which would all be independent of each other.

        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        82 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        43 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        56 views
        0 likes
        Last Post CarlTrading  
        Working...
        X