Skip to content

Instantly share code, notes, and snippets.

@hanuor
hanuor / test.py
Created December 22, 2022 08:45 — forked from pawiromitchel/test.py
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__)
@hanuor
hanuor / OkHttpStack.java
Created March 30, 2018 04:45 — forked from JakeWharton/OkHttpStack.java
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.
*/