Spread recording fail - page 2

 

There is a sandbox around the file functions. It has an easy check, that the file name does not contain a double dot (..), which could be used to escape from the sandbox (..\..\..\far_away_folder\myfile.txt). So replace the dots by some other character.

 
pontuso:

Ok thanks for the correction!

I get this error. ERR_WRONG_FILE_NAME (4101)

12:38:50 Spread_Recordera_1_: invalid filename for FileOpen function

12:38:50 Spread_Recordera_1_ EURUSD..,H1: FileOpen failed, trying to open: Spread_Recording/EURUSD..-Spread_Recorder-8-1-2014.log error# 4101


I have seen that the demo account symbol name is "EURUSD.m" and the real account symbol is named "EURUSD.." can this might cause the error?

It could be, error 4101 is "Wrong file name." . . . try this mod, it's not a solution it's just for testing:

void WriteToLogFile(string input)
{
   string RealSymbol;  //  added by RaptorUK
   
   RealSymbol = StringSubstr(Symbol(), 0, 6);   //  added by RaptorUK
   
   string filename = "Spread_Recording/"+  RealSymbol +"-Spread_Recorder-"+Day()+"-"+Month()+"-"+Year()+".log";  // RaptorUK Symbol() replaced with RealSymbol
   input = TimeHour(TimeCurrent())+":"+TimeMinute(TimeCurrent())+":"+TimeSeconds(TimeCurrent())+" - "+input;
Files:
 
Ovo:

There is a sandbox around the file functions. It has an easy check, that the file name does not contain a double dot (..), which could be used to escape from the sandbox (..\..\..\far_away_folder\myfile.txt). So replace the dots by some other character.


Do you mean by changing the pair name in the platform, is that possible?
 
RaptorUK:

It could be, error 4101 is "Wrong file name." . . . try this mod, it's not a solution it's just for testing:


This worked! why is this just for "testing"?
 
pontuso: 11:12:29 Spread_Recorder: invalid filename for FileOpen function
   string filename = "Spread_Recording/"+Symbol()+"-Spread_Recorder-"+Day()+"-"+Month()+"-"+Year()+".log";
  1. Do you have a directory called "Spread_Recording" under TERMINAL\experts\files or TERMINAL\tester\files? Either create it or remove the forward slash.
  2. Under windows paths use a backslash not forward slash. Try quoted backslash.
    "Spread_Recording\\"+ ...
 
pontuso:

Do you mean by changing the pair name in the platform, is that possible?

No, it is not possible. You should replace dots in the file name.
 
pontuso:

This worked! why is this just for "testing"?
Probably not all symbols are 6 characters followed by dot dot . . . if they are then yes it will work for all cases, but a permanent solution would be to remove the invalid characters, the dots.
 

Great

Thanks for all the help! you re awesome!

 

Spread


The forum

  • spreadometer_v2.01 indicator fixed version - the post.
  • Spread recording fail - the thread with the indicator (fixing bug thread).
  • Spread and StopLoss indicator with alert - the thread 
  • Tools to monitor spread and swap - the thread with many good tools
  • Spread monitoring and show leverage tools - the thread 
  • FunIndicator indicator - the thread (monitor spread, swap etc for many pairs in one window).
  • Meh Spread Indicator thread 

The articles

CodeBase

============

Reason: