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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        672 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X