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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        44 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        56 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        35 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        95 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        57 views
        0 likes
        Last Post PaulMohn  
        Working...
        X