├── Donate └── QR-Github-Paypal.png ├── Example ├── Java │ ├── target │ │ ├── classes │ │ │ └── test │ │ │ │ └── App.class │ │ ├── test-1.0-SNAPSHOT.jar │ │ ├── maven-status │ │ │ └── maven-compiler-plugin │ │ │ │ ├── compile │ │ │ │ └── default-compile │ │ │ │ │ └── inputFiles.lst │ │ │ │ └── testCompile │ │ │ │ └── default-testCompile │ │ │ │ └── inputFiles.lst │ │ ├── test-classes │ │ │ └── test │ │ │ │ └── AppTest.class │ │ ├── maven-archiver │ │ │ └── pom.properties │ │ └── surefire-reports │ │ │ ├── test.AppTest.txt │ │ │ └── TEST-test.AppTest.xml │ ├── src │ │ ├── test │ │ │ └── java │ │ │ │ └── test │ │ │ │ └── AppTest.java │ │ └── main │ │ │ └── java │ │ │ └── test │ │ │ └── App.java │ ├── maven-build.properties │ ├── build.xml │ ├── pom.xml │ └── maven-build.xml ├── C-Sharp │ ├── ConsoleQuotes │ │ ├── ConsoleQuotes.csproj │ │ ├── MT4 │ │ │ └── Response.cs │ │ └── Program.cs │ ├── ConsoleQuotes.sln │ └── .gitignore ├── PHP │ └── Subscribe.php └── Python │ ├── Subscribe.py │ └── .gitignore ├── .gitignore ├── LICENSE ├── README.md └── Src ├── MQL4 └── Scripts │ └── JiowclQuoteServer.mq4 └── MQL5 └── Scripts └── JiowclQuoteServer.mq5 /Donate/QR-Github-Paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiowcl/MQL-Quotes/HEAD/Donate/QR-Github-Paypal.png -------------------------------------------------------------------------------- /Example/Java/target/classes/test/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiowcl/MQL-Quotes/HEAD/Example/Java/target/classes/test/App.class -------------------------------------------------------------------------------- /Example/Java/target/test-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiowcl/MQL-Quotes/HEAD/Example/Java/target/test-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /Example/Java/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst: -------------------------------------------------------------------------------- 1 | D:\Developer\Jiowcl\java\test\src\main\java\test\App.java 2 | -------------------------------------------------------------------------------- /Example/Java/target/test-classes/test/AppTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiowcl/MQL-Quotes/HEAD/Example/Java/target/test-classes/test/AppTest.class -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### VisualStudioCode ### 2 | .vscode/* 3 | !.vscode/settings.json 4 | !.vscode/tasks.json 5 | !.vscode/launch.json 6 | 7 | ### Global ### 8 | *.ex4 9 | *.ex5 -------------------------------------------------------------------------------- /Example/Java/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst: -------------------------------------------------------------------------------- 1 | D:\Developer\Jiowcl\java\test\src\test\java\test\AppTest.java 2 | -------------------------------------------------------------------------------- /Example/Java/target/maven-archiver/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven 2 | #Tue May 07 15:32:34 CST 2019 3 | version=1.0-SNAPSHOT 4 | groupId=test 5 | artifactId=test 6 | -------------------------------------------------------------------------------- /Example/Java/target/surefire-reports/test.AppTest.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: test.AppTest 3 | ------------------------------------------------------------------------------- 4 | Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.063 sec 5 | -------------------------------------------------------------------------------- /Example/Java/src/test/java/test/AppTest.java: -------------------------------------------------------------------------------- 1 | package test; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest { 11 | /** 12 | * Rigorous Test. 13 | */ 14 | @Test 15 | public void testApp() { 16 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/C-Sharp/ConsoleQuotes/ConsoleQuotes.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.1 6 | Ji-Feng Tsai 7 | 8 | Demo application for MQL Quotes 9 | Copyright Jiowcl 2019 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Example/C-Sharp/ConsoleQuotes/MT4/Response.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ConsoleQuotes.MT4 6 | { 7 | /// 8 | /// Response 9 | /// 10 | public class Response 11 | { 12 | /// 13 | /// Login 14 | /// 15 | public int Login { get; set; } 16 | 17 | /// 18 | /// Symbol 19 | /// 20 | public string Symbol { get; set; } 21 | 22 | /// 23 | /// Ask 24 | /// 25 | public double Ask { get; set; } 26 | 27 | /// 28 | /// Bid 29 | /// 30 | public double Bid { get; set; } 31 | 32 | /// 33 | /// Spread 34 | /// 35 | public int Spread { get; set; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Example/PHP/Subscribe.php: -------------------------------------------------------------------------------- 1 | connect($serverAddr ); 7 | $socket->setSockOpt(ZMQ::SOCKOPT_SUBSCRIBE, ""); 8 | 9 | // Zmq blocking mode for received the message 10 | while ($enabled) { 11 | $messageReceived = trim($socket->recv()); 12 | $messageData = explode(" ", $messageReceived); 13 | 14 | if (count($messageData) != 2) 15 | continue; 16 | 17 | $orderData = explode("|", $messageData[1]); 18 | 19 | if (count($orderData) != 4) 20 | continue; 21 | 22 | print_r([ 23 | "Login" => $messageData[0], 24 | "Symbol" => $orderData[0], 25 | "Ask" => $orderData[1], 26 | "Bid" => $orderData[2], 27 | "Spread" => $orderData[3] 28 | ]); 29 | } 30 | 31 | $socket->disconnect($serverAddr ); -------------------------------------------------------------------------------- /Example/Python/Subscribe.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import sys 3 | import time 4 | 5 | import zmq 6 | import numpy 7 | 8 | def main(): 9 | connect_to = "tcp://127.0.0.1:5559" 10 | topics = "" 11 | 12 | ctx = zmq.Context() 13 | s = ctx.socket(zmq.SUB) 14 | s.connect(connect_to) 15 | s.setsockopt(zmq.SUBSCRIBE, b'') 16 | 17 | try: 18 | while True: 19 | recv = s.recv_multipart() 20 | recvMsg = recv[0].decode("utf-8") 21 | message = recvMsg.split(" ") 22 | quotes = message[1].split("|") 23 | 24 | v_symbol = quotes[0] 25 | v_ask = quotes[1] 26 | v_bid = quotes[2] 27 | v_spread = quotes[3] 28 | 29 | print("Symbol: ", v_symbol, ", Ask: ", v_ask, ", Bid: ", v_bid, ", Spread: ", v_spread) 30 | except KeyboardInterrupt: 31 | pass 32 | 33 | if __name__ == "__main__": 34 | main() 35 | -------------------------------------------------------------------------------- /Example/Java/maven-build.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Ant Plugin - DO NOT EDIT THIS FILE! 2 | #Tue May 07 15:30:42 CST 2019 3 | maven.settings.offline=false 4 | maven.build.finalName=test-1.0-SNAPSHOT 5 | maven.build.resourceDir.0=src/main/resources 6 | maven.build.testOutputDir=${maven.build.dir}/test-classes 7 | maven.build.testResourceDir.0=src/test/resources 8 | maven.reporting.outputDirectory=${maven.build.dir}/site 9 | project.build.sourceEncoding=UTF-8 10 | maven.compiler.source=1.8 11 | maven.build.srcDir.0=src/main/java 12 | project.build.directory=${maven.build.dir} 13 | maven.test.reports=${maven.build.dir}/test-reports 14 | maven.build.dir=target 15 | project.build.outputDirectory=${maven.build.outputDir} 16 | maven.compiler.target=1.8 17 | maven.build.testDir.0=src/test/java 18 | maven.settings.interactiveMode=true 19 | maven.repo.local=${user.home}/.m2/repository 20 | maven.build.outputDir=${maven.build.dir}/classes 21 | -------------------------------------------------------------------------------- /Example/Java/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Jiowcl 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Example/C-Sharp/ConsoleQuotes.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28803.156 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleQuotes", "ConsoleQuotes\ConsoleQuotes.csproj", "{7E2F340F-9D79-4BED-9AFB-01E321987CC1}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {7E2F340F-9D79-4BED-9AFB-01E321987CC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {7E2F340F-9D79-4BED-9AFB-01E321987CC1}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {7E2F340F-9D79-4BED-9AFB-01E321987CC1}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {7E2F340F-9D79-4BED-9AFB-01E321987CC1}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {31003C8A-80E9-473D-86D8-D3504C977D7E} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MQL-Quotes 2 | 3 | MT4/MT5 Client Quotes Export, Can be easily integrated with personal websites without the MT4/MT5 Manager API. 4 | 5 | ![GitHub](https://img.shields.io/github/license/jiowcl/MQL-Quotes.svg) 6 | ![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/dingmaotu/mql-zmq.svg) 7 | 8 | ## Environment 9 | 10 | - Windows 7 above (recommend) 11 | - MetaTrader 4 Client / MetaTrader 5 Client 12 | - [ZeroMQ](https://github.com/zeromq) 13 | - [ZeroMQ for MQL](https://github.com/dingmaotu/mql-zmq) 14 | 15 | ## Features 16 | 17 | - Remote Publisher and Subscriber (Based on IP address) 18 | - Custom export symbols in MarketWatch 19 | 20 | ## License 21 | 22 | Copyright (c) 2017-2024 Ji-Feng Tsai. 23 | MQL-Zmq Copyright (c) Ding Li [ZeroMQ for MQL](https://github.com/dingmaotu). 24 | 25 | Code released under the MIT license. 26 | 27 | ## TODO 28 | 29 | - More examples 30 | 31 | ## Donation 32 | 33 | If this application help you reduce time to trading, you can give me a cup of coffee :) 34 | 35 | [![paypal](https://www.paypalobjects.com/en_US/TW/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3RNMD6Q3B495N&source=url) 36 | 37 | [Paypal Me](https://paypal.me/jiowcl?locale.x=zh_TW) -------------------------------------------------------------------------------- /Example/Java/src/main/java/test/App.java: -------------------------------------------------------------------------------- 1 | package test; 2 | 3 | import org.zeromq.SocketType; 4 | import org.zeromq.ZMQ; 5 | import org.zeromq.ZContext; 6 | 7 | /** 8 | * Test 9 | */ 10 | public final class App { 11 | private App() { 12 | 13 | } 14 | 15 | /** 16 | * Main. 17 | * @param args The arguments of the program. 18 | */ 19 | public static void main(String[] args) { 20 | ZContext context = new ZContext(); 21 | ZMQ.Socket subscriber = context.createSocket(SocketType.SUB); 22 | 23 | Boolean enabled = true; 24 | String serverAddr = "tcp://localhost:5559"; 25 | 26 | subscriber.connect(serverAddr); 27 | subscriber.subscribe(""); 28 | 29 | while (enabled) { 30 | String messageReceived = subscriber.recvStr(0).trim(); 31 | String[] messageData = messageReceived.split(" "); 32 | 33 | if (messageData.length != 2) 34 | continue; 35 | 36 | String[] quoteData = messageData[1].toString().split("\\|"); 37 | 38 | if (quoteData.length != 4) 39 | continue; 40 | 41 | System.out.println("Login: " + messageData[0] + ", Symbol: " + quoteData[0] + ", Ask: " + quoteData[1] + ", Bid: " + quoteData[2] + ", Spread: " + quoteData[3]); 42 | } 43 | 44 | subscriber.disconnect(serverAddr); 45 | subscriber.close(); 46 | 47 | context.close(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Example/C-Sharp/ConsoleQuotes/Program.cs: -------------------------------------------------------------------------------- 1 | using NetMQ; 2 | using NetMQ.Sockets; 3 | using System; 4 | using ConsoleQuotes.MT4; 5 | 6 | namespace ConsoleQuotes 7 | { 8 | public class Program 9 | { 10 | /// 11 | /// Main 12 | /// 13 | public static void Main(string[] args) 14 | { 15 | using (SubscriberSocket subSocket = new SubscriberSocket()) 16 | { 17 | subSocket.Options.ReceiveHighWatermark = 1000; 18 | 19 | subSocket.Connect("tcp://localhost:5559"); 20 | subSocket.Subscribe(""); 21 | 22 | while (true) 23 | { 24 | string messageReceived = subSocket.ReceiveFrameString(); 25 | string[] messageData = messageReceived.Split(' '); 26 | 27 | if (messageData.Length != 2) 28 | continue; 29 | 30 | string[] quotesData = messageData[1].Split('|'); 31 | 32 | if (quotesData.Length != 4) 33 | continue; 34 | 35 | Response response = new Response 36 | { 37 | Login = int.Parse(messageData[0]), 38 | Symbol = quotesData[0], 39 | Ask = double.Parse(quotesData[1]), 40 | Bid = double.Parse(quotesData[2]), 41 | Spread = int.Parse(quotesData[3]) 42 | }; 43 | 44 | Console.WriteLine("Login: " + response.Login + ", Symbol: " + response.Symbol + ", Ask: " + response.Ask + ", Bid: " + response.Bid, ", Spread: " + response.Spread); 45 | } 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Example/Python/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/python 2 | # Edit at https://www.gitignore.io/?templates=python 3 | 4 | ### Python ### 5 | # Byte-compiled / optimized / DLL files 6 | __pycache__/ 7 | *.py[cod] 8 | *$py.class 9 | 10 | # C extensions 11 | *.so 12 | 13 | # Distribution / packaging 14 | .Python 15 | build/ 16 | develop-eggs/ 17 | dist/ 18 | downloads/ 19 | eggs/ 20 | .eggs/ 21 | lib/ 22 | lib64/ 23 | parts/ 24 | sdist/ 25 | var/ 26 | wheels/ 27 | pip-wheel-metadata/ 28 | share/python-wheels/ 29 | *.egg-info/ 30 | .installed.cfg 31 | *.egg 32 | MANIFEST 33 | 34 | # PyInstaller 35 | # Usually these files are written by a python script from a template 36 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 37 | *.manifest 38 | *.spec 39 | 40 | # Installer logs 41 | pip-log.txt 42 | pip-delete-this-directory.txt 43 | 44 | # Unit test / coverage reports 45 | htmlcov/ 46 | .tox/ 47 | .nox/ 48 | .coverage 49 | .coverage.* 50 | .cache 51 | nosetests.xml 52 | coverage.xml 53 | *.cover 54 | .hypothesis/ 55 | .pytest_cache/ 56 | 57 | # Translations 58 | *.mo 59 | *.pot 60 | 61 | # Django stuff: 62 | *.log 63 | local_settings.py 64 | db.sqlite3 65 | 66 | # Flask stuff: 67 | instance/ 68 | .webassets-cache 69 | 70 | # Scrapy stuff: 71 | .scrapy 72 | 73 | # Sphinx documentation 74 | docs/_build/ 75 | 76 | # PyBuilder 77 | target/ 78 | 79 | # Jupyter Notebook 80 | .ipynb_checkpoints 81 | 82 | # IPython 83 | profile_default/ 84 | ipython_config.py 85 | 86 | # pyenv 87 | .python-version 88 | 89 | # pipenv 90 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 91 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 92 | # having no cross-platform support, pipenv may install dependencies that don’t work, or not 93 | # install all needed dependencies. 94 | #Pipfile.lock 95 | 96 | # celery beat schedule file 97 | celerybeat-schedule 98 | 99 | # SageMath parsed files 100 | *.sage.py 101 | 102 | # Environments 103 | .env 104 | .venv 105 | env/ 106 | venv/ 107 | ENV/ 108 | env.bak/ 109 | venv.bak/ 110 | 111 | # Spyder project settings 112 | .spyderproject 113 | .spyproject 114 | 115 | # Rope project settings 116 | .ropeproject 117 | 118 | # mkdocs documentation 119 | /site 120 | 121 | # mypy 122 | .mypy_cache/ 123 | .dmypy.json 124 | dmypy.json 125 | 126 | # Pyre type checker 127 | .pyre/ 128 | 129 | # End of https://www.gitignore.io/api/python -------------------------------------------------------------------------------- /Example/Java/target/surefire-reports/TEST-test.AppTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /Example/Java/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | test 5 | test 6 | 1.0-SNAPSHOT 7 | 8 | 1.8 9 | 1.8 10 | UTF-8 11 | 12 | 13 | 14 | junit 15 | junit 16 | 4.13.1 17 | test 18 | 19 | 20 | org.zeromq 21 | jeromq 22 | 0.5.1 23 | 24 | 25 | 26 | 27 | 28 | 29 | org.apache.maven.plugins 30 | maven-checkstyle-plugin 31 | 3.0.0 32 | 33 | 34 | com.puppycrawl.tools 35 | checkstyle 36 | 8.29 37 | 38 | 39 | com.github.ngeor 40 | checkstyle-rules 41 | 1.1.0 42 | 43 | 44 | 45 | com/github/ngeor/checkstyle.xml 46 | true 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-checkstyle-plugin 55 | 56 | 57 | 61 | 62 | org.jacoco 63 | jacoco-maven-plugin 64 | 0.8.1 65 | 66 | 67 | 68 | 69 | 70 | 71 | org.apache.maven.plugins 72 | maven-javadoc-plugin 73 | 3.0.0 74 | 75 | 76 | org.apache.maven.plugins 77 | maven-checkstyle-plugin 78 | 79 | com/github/ngeor/checkstyle.xml 80 | true 81 | 82 | 83 | 84 | 85 | 86 | 87 | 92 | 93 | jacoco 94 | 95 | 96 | env.TRAVIS 97 | 98 | 99 | 100 | 101 | 102 | org.jacoco 103 | jacoco-maven-plugin 104 | 105 | 106 | prepare-agent 107 | validate 108 | 109 | prepare-agent 110 | 111 | 112 | 113 | report 114 | test 115 | 116 | report 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 130 | 131 | travis 132 | 133 | 134 | env.TRAVIS 135 | 136 | 137 | 138 | 139 | 140 | org.apache.maven.plugins 141 | maven-checkstyle-plugin 142 | 143 | 144 | checkstyle 145 | test 146 | 147 | check 148 | 149 | 150 | 151 | 152 | 153 | org.eluder.coveralls 154 | coveralls-maven-plugin 155 | 4.3.0 156 | 157 | 158 | 159 | 160 | 161 | 162 | -------------------------------------------------------------------------------- /Example/C-Sharp/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/visualstudio 2 | # Edit at https://www.gitignore.io/?templates=visualstudio 3 | 4 | ### VisualStudio ### 5 | ## Ignore Visual Studio temporary files, build results, and 6 | ## files generated by popular Visual Studio add-ons. 7 | ## 8 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 9 | 10 | # User-specific files 11 | *.rsuser 12 | *.suo 13 | *.user 14 | *.userosscache 15 | *.sln.docstates 16 | 17 | # User-specific files (MonoDevelop/Xamarin Studio) 18 | *.userprefs 19 | 20 | # Mono auto generated files 21 | mono_crash.* 22 | 23 | # Build results 24 | [Dd]ebug/ 25 | [Dd]ebugPublic/ 26 | [Rr]elease/ 27 | [Rr]eleases/ 28 | x64/ 29 | x86/ 30 | [Aa][Rr][Mm]/ 31 | [Aa][Rr][Mm]64/ 32 | bld/ 33 | [Bb]in/ 34 | [Oo]bj/ 35 | [Ll]og/ 36 | 37 | # Visual Studio 2015/2017 cache/options directory 38 | .vs/ 39 | # Uncomment if you have tasks that create the project's static files in wwwroot 40 | #wwwroot/ 41 | 42 | # Visual Studio 2017 auto generated files 43 | Generated\ Files/ 44 | 45 | # MSTest test Results 46 | [Tt]est[Rr]esult*/ 47 | [Bb]uild[Ll]og.* 48 | 49 | # NUNIT 50 | *.VisualState.xml 51 | TestResult.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # StyleCop 67 | StyleCopReport.xml 68 | 69 | # Files built by Visual Studio 70 | *_i.c 71 | *_p.c 72 | *_h.h 73 | *.ilk 74 | *.meta 75 | *.obj 76 | *.iobj 77 | *.pch 78 | *.pdb 79 | *.ipdb 80 | *.pgc 81 | *.pgd 82 | *.rsp 83 | *.sbr 84 | *.tlb 85 | *.tli 86 | *.tlh 87 | *.tmp 88 | *.tmp_proj 89 | *_wpftmp.csproj 90 | *.log 91 | *.vspscc 92 | *.vssscc 93 | .builds 94 | *.pidb 95 | *.svclog 96 | *.scc 97 | 98 | # Chutzpah Test files 99 | _Chutzpah* 100 | 101 | # Visual C++ cache files 102 | ipch/ 103 | *.aps 104 | *.ncb 105 | *.opendb 106 | *.opensdf 107 | *.sdf 108 | *.cachefile 109 | *.VC.db 110 | *.VC.VC.opendb 111 | 112 | # Visual Studio profiler 113 | *.psess 114 | *.vsp 115 | *.vspx 116 | *.sap 117 | 118 | # Visual Studio Trace Files 119 | *.e2e 120 | 121 | # TFS 2012 Local Workspace 122 | $tf/ 123 | 124 | # Guidance Automation Toolkit 125 | *.gpState 126 | 127 | # ReSharper is a .NET coding add-in 128 | _ReSharper*/ 129 | *.[Rr]e[Ss]harper 130 | *.DotSettings.user 131 | 132 | # JustCode is a .NET coding add-in 133 | .JustCode 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Visual Studio code coverage results 146 | *.coverage 147 | *.coveragexml 148 | 149 | # NCrunch 150 | _NCrunch_* 151 | .*crunch*.local.xml 152 | nCrunchTemp_* 153 | 154 | # MightyMoose 155 | *.mm.* 156 | AutoTest.Net/ 157 | 158 | # Web workbench (sass) 159 | .sass-cache/ 160 | 161 | # Installshield output folder 162 | [Ee]xpress/ 163 | 164 | # DocProject is a documentation generator add-in 165 | DocProject/buildhelp/ 166 | DocProject/Help/*.HxT 167 | DocProject/Help/*.HxC 168 | DocProject/Help/*.hhc 169 | DocProject/Help/*.hhk 170 | DocProject/Help/*.hhp 171 | DocProject/Help/Html2 172 | DocProject/Help/html 173 | 174 | # Click-Once directory 175 | publish/ 176 | 177 | # Publish Web Output 178 | *.[Pp]ublish.xml 179 | *.azurePubxml 180 | # Note: Comment the next line if you want to checkin your web deploy settings, 181 | # but database connection strings (with potential passwords) will be unencrypted 182 | *.pubxml 183 | *.publishproj 184 | 185 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 186 | # checkin your Azure Web App publish settings, but sensitive information contained 187 | # in these scripts will be unencrypted 188 | PublishScripts/ 189 | 190 | # NuGet Packages 191 | *.nupkg 192 | # The packages folder can be ignored because of Package Restore 193 | **/[Pp]ackages/* 194 | # except build/, which is used as an MSBuild target. 195 | !**/[Pp]ackages/build/ 196 | # Uncomment if necessary however generally it will be regenerated when needed 197 | #!**/[Pp]ackages/repositories.config 198 | # NuGet v3's project.json files produces more ignorable files 199 | *.nuget.props 200 | *.nuget.targets 201 | 202 | # Microsoft Azure Build Output 203 | csx/ 204 | *.build.csdef 205 | 206 | # Microsoft Azure Emulator 207 | ecf/ 208 | rcf/ 209 | 210 | # Windows Store app package directories and files 211 | AppPackages/ 212 | BundleArtifacts/ 213 | Package.StoreAssociation.xml 214 | _pkginfo.txt 215 | *.appx 216 | *.appxbundle 217 | *.appxupload 218 | 219 | # Visual Studio cache files 220 | # files ending in .cache can be ignored 221 | *.[Cc]ache 222 | # but keep track of directories ending in .cache 223 | !?*.[Cc]ache/ 224 | 225 | # Others 226 | ClientBin/ 227 | ~$* 228 | *~ 229 | *.dbmdl 230 | *.dbproj.schemaview 231 | *.jfm 232 | *.pfx 233 | *.publishsettings 234 | orleans.codegen.cs 235 | 236 | # Including strong name files can present a security risk 237 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 238 | #*.snk 239 | 240 | # Since there are multiple workflows, uncomment next line to ignore bower_components 241 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 242 | #bower_components/ 243 | 244 | # RIA/Silverlight projects 245 | Generated_Code/ 246 | 247 | # Backup & report files from converting an old project file 248 | # to a newer Visual Studio version. Backup files are not needed, 249 | # because we have git ;-) 250 | _UpgradeReport_Files/ 251 | Backup*/ 252 | UpgradeLog*.XML 253 | UpgradeLog*.htm 254 | ServiceFabricBackup/ 255 | *.rptproj.bak 256 | 257 | # SQL Server files 258 | *.mdf 259 | *.ldf 260 | *.ndf 261 | 262 | # Business Intelligence projects 263 | *.rdl.data 264 | *.bim.layout 265 | *.bim_*.settings 266 | *.rptproj.rsuser 267 | *- Backup*.rdl 268 | 269 | # Microsoft Fakes 270 | FakesAssemblies/ 271 | 272 | # GhostDoc plugin setting file 273 | *.GhostDoc.xml 274 | 275 | # Node.js Tools for Visual Studio 276 | .ntvs_analysis.dat 277 | node_modules/ 278 | 279 | # Visual Studio 6 build log 280 | *.plg 281 | 282 | # Visual Studio 6 workspace options file 283 | *.opt 284 | 285 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 286 | *.vbw 287 | 288 | # Visual Studio LightSwitch build output 289 | **/*.HTMLClient/GeneratedArtifacts 290 | **/*.DesktopClient/GeneratedArtifacts 291 | **/*.DesktopClient/ModelManifest.xml 292 | **/*.Server/GeneratedArtifacts 293 | **/*.Server/ModelManifest.xml 294 | _Pvt_Extensions 295 | 296 | # Paket dependency manager 297 | .paket/paket.exe 298 | paket-files/ 299 | 300 | # FAKE - F# Make 301 | .fake/ 302 | 303 | # CodeRush personal settings 304 | .cr/personal 305 | 306 | # Python Tools for Visual Studio (PTVS) 307 | __pycache__/ 308 | *.pyc 309 | 310 | # Cake - Uncomment if you are using it 311 | # tools/** 312 | # !tools/packages.config 313 | 314 | # Tabs Studio 315 | *.tss 316 | 317 | # Telerik's JustMock configuration file 318 | *.jmconfig 319 | 320 | # BizTalk build output 321 | *.btp.cs 322 | *.btm.cs 323 | *.odx.cs 324 | *.xsd.cs 325 | 326 | # OpenCover UI analysis results 327 | OpenCover/ 328 | 329 | # Azure Stream Analytics local run output 330 | ASALocalRun/ 331 | 332 | # MSBuild Binary and Structured Log 333 | *.binlog 334 | 335 | # NVidia Nsight GPU debugger configuration file 336 | *.nvuser 337 | 338 | # MFractors (Xamarin productivity tool) working folder 339 | .mfractor/ 340 | 341 | # Local History for Visual Studio 342 | .localhistory/ 343 | 344 | # BeatPulse healthcheck temp database 345 | healthchecksdb 346 | 347 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 348 | MigrationBackup/ 349 | 350 | # End of https://www.gitignore.io/api/visualstudio -------------------------------------------------------------------------------- /Src/MQL4/Scripts/JiowclQuoteServer.mq4: -------------------------------------------------------------------------------- 1 | //+------------------------------------------------------------------+ 2 | //| JiowclQuoteServer.mq4 | 3 | //| Copyright 2017-2024, Ji-Feng Tsai | 4 | //| https://github.com/jiowcl | 5 | //+------------------------------------------------------------------+ 6 | #property copyright "Copyright 2024, Ji-Feng Tsai" 7 | #property link "https://github.com/jiowcl/MQL-Quotes" 8 | #property version "1.00" 9 | #property description "MT4 Quote export application. Push all quotes price to subscribers." 10 | #property strict 11 | #property show_inputs 12 | 13 | #include 14 | 15 | //--- Inputs 16 | input string Server = "tcp://*:5559"; // Push server ip 17 | input uint ServerDelayMilliseconds = 300; // Push to clients delay milliseconds (Default is 300) 18 | input bool ServerReal = false; // Under real server (Default is false) 19 | input string AllowSymbols = ""; // Allow Trading Symbols (Ex: EURUSDq,EURUSDx,EURUSDa) 20 | input bool OnlyInMarketWatch = true; // Only push the symbols in marketwatch (Default is true) 21 | 22 | //--- Globales Struct 23 | struct Symbols 24 | { 25 | double bid; 26 | double ask; 27 | double point; 28 | int digits; 29 | int spread; 30 | }; 31 | 32 | //--- Globales Application 33 | const string app_name = "Jiowcl Expert Advisor"; 34 | 35 | //--- Globales ZMQ 36 | Context context; 37 | Socket publisher(context, ZMQ_PUB); 38 | 39 | string zmq_server = ""; 40 | uint zmq_pushdelay = 0; 41 | bool zmq_runningstatus = false; 42 | 43 | //--- Globales Symbol 44 | int symbolinfosize = 0; 45 | bool symbolinmarketwatch = false; 46 | Symbols symbolinfo[]; 47 | 48 | int prev_symbolinfosize = 0; 49 | 50 | //--- Globales File 51 | string local_symbolallow[]; 52 | int symbolallow_size = 0; 53 | 54 | //+------------------------------------------------------------------+ 55 | //| Script program start function | 56 | //+------------------------------------------------------------------+ 57 | void OnStart() 58 | { 59 | if (DetectEnvironment() == false) 60 | { 61 | Alert("Error: The property is fail, please check and try again."); 62 | return; 63 | } 64 | 65 | StartZmqServer(); 66 | } 67 | 68 | //+------------------------------------------------------------------+ 69 | //| Override deinit function | 70 | //+------------------------------------------------------------------+ 71 | void OnDeinit(const int reason) 72 | { 73 | StopZmqServer(); 74 | } 75 | 76 | //+------------------------------------------------------------------+ 77 | //| Detect the script parameters | 78 | //+------------------------------------------------------------------+ 79 | bool DetectEnvironment() 80 | { 81 | if (Server == "") 82 | return false; 83 | 84 | if (ServerReal == true && IsDemo()) 85 | { 86 | Print("Account is Demo, please switch the Demo account to Real account."); 87 | return false; 88 | } 89 | 90 | if (IsDllsAllowed() == false) 91 | { 92 | Print("DLL call is not allowed. ", app_name, " cannot run."); 93 | return false; 94 | } 95 | 96 | zmq_server = Server; 97 | zmq_pushdelay = (ServerDelayMilliseconds > 0) ? ServerDelayMilliseconds : 10; 98 | zmq_runningstatus = false; 99 | symbolinmarketwatch = OnlyInMarketWatch; 100 | 101 | // Load the Symbol allow map 102 | if (AllowSymbols != "") 103 | { 104 | string symboldata[]; 105 | int symbolsize = StringSplit(AllowSymbols, ',', symboldata); 106 | int symbolindex = 0; 107 | 108 | ArrayResize(local_symbolallow, symbolsize); 109 | 110 | for (symbolindex=0; symbolindex 0) 155 | UpdateCurrentSymbolsOnTicket(); 156 | 157 | tickcount = GetTickCount() - ticketstart; 158 | 159 | if (delay > tickcount) 160 | Sleep(delay-tickcount-2); 161 | } 162 | } 163 | 164 | //+------------------------------------------------------------------+ 165 | //| Stop the zmq server | 166 | //+------------------------------------------------------------------+ 167 | void StopZmqServer() 168 | { 169 | if (zmq_server == "") 170 | return; 171 | 172 | ArrayFree(symbolinfo); 173 | ArrayFree(local_symbolallow); 174 | 175 | Print("Unload Server: ", zmq_server); 176 | 177 | if (zmq_runningstatus == true) 178 | publisher.unbind(zmq_server); 179 | 180 | zmq_runningstatus = false; 181 | } 182 | 183 | //+------------------------------------------------------------------+ 184 | //| Get all of the symbols | 185 | //+------------------------------------------------------------------+ 186 | int GetCurrentSymbolsOnTicket() 187 | { 188 | int changed = 0; 189 | int symbolindex = 0; 190 | 191 | symbolinfosize = SymbolsTotal(symbolinmarketwatch); 192 | 193 | if (symbolinfosize > 0 && symbolinfosize != prev_symbolinfosize) 194 | { 195 | ArrayResize(symbolinfo, symbolinfosize); 196 | } 197 | 198 | prev_symbolinfosize = symbolinfosize; 199 | 200 | for (symbolindex=0; symbolindex 14 | 15 | //--- Inputs 16 | input string Server = "tcp://*:5559"; // Push server ip 17 | input uint ServerDelayMilliseconds = 300; // Push to clients delay milliseconds (Default is 300) 18 | input bool ServerReal = false; // Under real server (Default is false) 19 | input string AllowSymbols = ""; // Allow Trading Symbols (Ex: EURUSDq,EURUSDx,EURUSDa) 20 | input bool OnlyInMarketWatch = true; // Only push the symbols in marketwatch (Default is true) 21 | 22 | //--- Globales Struct 23 | struct Symbols 24 | { 25 | double bid; 26 | double ask; 27 | double point; 28 | int digits; 29 | int spread; 30 | string category; 31 | string country; 32 | }; 33 | 34 | //--- Globales Application 35 | const string app_name = "Jiowcl Expert Advisor"; 36 | 37 | //--- Globales ZMQ 38 | Context context; 39 | Socket publisher(context, ZMQ_PUB); 40 | 41 | string zmq_server = ""; 42 | uint zmq_pushdelay = 0; 43 | bool zmq_runningstatus = false; 44 | 45 | //--- Globales Symbol 46 | int symbolinfosize = 0; 47 | bool symbolinmarketwatch = false; 48 | Symbols symbolinfo[]; 49 | 50 | int prev_symbolinfosize = 0; 51 | 52 | //--- Globales File 53 | string local_symbolallow[]; 54 | int symbolallow_size = 0; 55 | 56 | //+------------------------------------------------------------------+ 57 | //| Script program start function | 58 | //+------------------------------------------------------------------+ 59 | void OnStart() 60 | { 61 | if (DetectEnvironment() == false) 62 | { 63 | Alert("Error: The property is fail, please check and try again."); 64 | return; 65 | } 66 | 67 | StartZmqServer(); 68 | StopZmqServer(); 69 | } 70 | 71 | //+------------------------------------------------------------------+ 72 | //| Detect the script parameters | 73 | //+------------------------------------------------------------------+ 74 | bool DetectEnvironment() 75 | { 76 | if (Server == "") 77 | return false; 78 | 79 | ENUM_ACCOUNT_TRADE_MODE accountTradeMode = (ENUM_ACCOUNT_TRADE_MODE) AccountInfoInteger(ACCOUNT_TRADE_MODE); 80 | 81 | if (ServerReal == true && accountTradeMode == ACCOUNT_TRADE_MODE_DEMO) 82 | { 83 | Print("Account is Demo, please switch the Demo account to Real account."); 84 | return false; 85 | } 86 | 87 | if ((bool) TerminalInfoInteger(TERMINAL_DLLS_ALLOWED) == false) 88 | { 89 | Print("DLL call is not allowed. ", app_name, " cannot run."); 90 | return false; 91 | } 92 | 93 | zmq_server = Server; 94 | zmq_pushdelay = (ServerDelayMilliseconds > 0) ? ServerDelayMilliseconds : 10; 95 | zmq_runningstatus = false; 96 | symbolinmarketwatch = OnlyInMarketWatch; 97 | 98 | // Load the Symbol allow map 99 | if (AllowSymbols != "") 100 | { 101 | string symboldata[]; 102 | int symbolsize = StringSplit(AllowSymbols, ',', symboldata); 103 | int symbolindex = 0; 104 | 105 | ArrayResize(local_symbolallow, symbolsize); 106 | 107 | for (symbolindex=0; symbolindex 0) 152 | UpdateCurrentSymbolsOnTicket(); 153 | 154 | tickcount = GetTickCount() - ticketstart; 155 | 156 | if (delay > tickcount) 157 | Sleep(delay-tickcount-2); 158 | } 159 | } 160 | 161 | //+------------------------------------------------------------------+ 162 | //| Stop the zmq server | 163 | //+------------------------------------------------------------------+ 164 | void StopZmqServer() 165 | { 166 | if (zmq_server == "") 167 | return; 168 | 169 | ArrayFree(symbolinfo); 170 | ArrayFree(local_symbolallow); 171 | 172 | Print("Unload Server: ", zmq_server); 173 | 174 | if (zmq_runningstatus == true) 175 | publisher.unbind(zmq_server); 176 | 177 | zmq_runningstatus = false; 178 | } 179 | 180 | //+------------------------------------------------------------------+ 181 | //| Get all of the symbols | 182 | //+------------------------------------------------------------------+ 183 | int GetCurrentSymbolsOnTicket() 184 | { 185 | int changed = 0; 186 | int symbolindex = 0; 187 | 188 | symbolinfosize = SymbolsTotal(symbolinmarketwatch); 189 | 190 | if (symbolinfosize > 0 && symbolinfosize != prev_symbolinfosize) 191 | { 192 | ArrayResize(symbolinfo, symbolinfosize); 193 | } 194 | 195 | prev_symbolinfosize = symbolinfosize; 196 | 197 | for (symbolindex=0; symbolindex 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 95 | 96 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 173 | =================================== WARNING =================================== 174 | JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed. 175 | =============================================================================== 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 237 | 238 | 239 | 243 | 244 | 248 | 249 | 253 | 254 | 258 | 259 | 260 | 261 | --------------------------------------------------------------------------------