.Set Files

 

I have two files First generated by Metatrader to save market watch symbols in a .Set files (set1.set)

the second one is (set2.set) and it is generated by a program.

I copied set2.set into MQL5\Profiles\SymbolSets path then i run metatrader5 

i can see bout set1 and set2 , but whenever i load set2 into MarketWatch, no symbols added to Marketwtch. 

so strange!!! they are the same but the second one is not working.

Files:
set1.set  1 kb
set2.set  1 kb
 

They're different.

I don't recognise the text within (haha), but when I open using notepad, set1.set shows 1 line, but set2.set shows 4 lines.

 
set1.set is Unix format, set2.set is DOS format. Maybe if you convert set2 into Unix format it will load.
 
saghez: so strange!!! they are the same but the second one is not working.

When I do (MT4) Market Watch → Sets → Save As … I get an ANSI file. Your set1 is Unicode BOM but your set2 is UTF-8.

 
Seng Joo Thio: I open using notepad, set1.set shows 1 line, but set2.set shows 4 lines.

Use Notepad2-mod

Notepad2-mod
  • xhmikosr.github.io
A modified version (fork) of Notepad2 based on Kai Liu's and other people's patches. Changes compared to the official Notepad2 Code folding Support for bookmarks Option to mark all occurrences of a word Word auto-completion Syntax highlighting support for AutoHotkey, AutoIt3, AviSynth, Bash, CMake, Inno Setup, LaTeX, Lua, Markdown, NSIS...
 
lippmaje:
set1.set is Unix format, set2.set is DOS format. Maybe if you convert set2 into Unix format it will load.

what is the difference.

both are Unicode. I Know that it contains Arabic character. I am using vb.net code to generate it 

        Dim OutPutFileName As String
        OutPutFileName = "C:\CSV\Trend.set"
        If File.Exists(OutPutFileName) Then File.Delete(OutPutFileName)
        Dim Fso As FileStream = New FileStream(OutPutFileName, FileMode.CreateNew, FileAccess.Write, FileShare.None)
        Fso.Close()
        Dim SwFromFileTrueUTF8 = New StreamWriter(OutPutFileName, True, System.Text.Encoding.UTF8)
        Dim i, Li As Integer
        Dim CellVal As String
        For i = 0 To Li
                        SwFromFileTrueUTF8.Write(Symbol(i) + vbLf)
            Next
        End With
        SwFromFileTrueUTF8.Flush()
        SwFromFileTrueUTF8.Close()
        MsgBox(OutPutFileName + " Created.")
 

I changed 

System.Text.Encoding.UTF8 

to

 System.Text.Encoding.Unicode  Now It works properly. Thanks Guys
Reason: