Skip to content

Instantly share code, notes, and snippets.

@pawiromitchel
pawiromitchel / test.py
Created April 26, 2020 22:01
MT5 | Place a trade programmatically with python
import requests as req
import json
import time
import MetaTrader5 as mt5
order = json.loads('{ "status": "NEW", "type": "BUY", "ticker": "EURUSD", "take_profit": "1.0820987897891143", "stop_loss": "1.0819768153163283" }')
# display data on the MetaTrader 5 package
print("MetaTrader5 package author: ", mt5.__author__)
print("MetaTrader5 package version: ", mt5.__version__)
#server side:
#server live directory: /var/www/domain.com
#server repository: /var/repo/site.git
1. clone project from git/bitbucket into /var/www/domain.com or init the folder by "git init".
2. go to /var/repo/site.git and init the folder as git bare
$git init --bare
--bare means that our folder will have no source files, just the version control.
@JakeWharton
JakeWharton / OkHttpStack.java
Created May 21, 2013 01:14
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
import com.android.volley.toolbox.HurlStack;
import com.squareup.okhttp.OkHttpClient;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which
* uses OkHttp as its transport.
*/