Update README.md
This commit is contained in:
@@ -19,10 +19,7 @@ Backtrader Python client located here: [Python Backtrader - Metaquotes MQL5 ](ht
|
||||
|
||||
In development:
|
||||
* Add error handling to docs
|
||||
* Trades info
|
||||
* Experation
|
||||
* Devitation
|
||||
* Netting/hedging mode switch
|
||||
* Stop limit orders
|
||||
|
||||
## Installation
|
||||
@@ -244,7 +241,7 @@ History data reply example:
|
||||
Buy market order.
|
||||
|
||||
``` python
|
||||
rep = api.construct_and_send(action="TRADE", actionType="ORDER_TYPE_BUY", symbol="EURUSD", "volume": 0.1, "stoploss": 1.1, "takeprofit": 1.3)
|
||||
rep = api.construct_and_send(action="TRADE", actionType="ORDER_TYPE_BUY", symbol="EURUSD", "volume"=0.1, "stoploss"=1.1, "takeprofit"=1.3)
|
||||
print(rep)
|
||||
```
|
||||
|
||||
@@ -254,7 +251,13 @@ Sell limit order. Remember to switch SL/TP depending on BUY/SELL, or you will ge
|
||||
- SELL: SL > price > TP
|
||||
|
||||
``` python
|
||||
rep = api.construct_and_send(action="TRADE", actionType="ORDER_TYPE_SELL_LIMIT", symbol="EURUSD", "volume": 0.1, "price": 1.2, "stoploss": 1.3, "takeprofit": 1.1)
|
||||
rep = api.construct_and_send(action="TRADE", actionType="ORDER_TYPE_SELL_LIMIT", symbol="EURUSD", "volume"=0.1, "price"=1.2, "stoploss"=1.3, "takeprofit"=1.1)
|
||||
print(rep)
|
||||
```
|
||||
All pending orders are set to `Good till cancel` by default. If you want to set an expiration date, pass the date in timestamp format to `expiration` param.
|
||||
|
||||
``` python
|
||||
rep = api.construct_and_send(action="TRADE", actionType="ORDER_TYPE_SELL_LIMIT", symbol="EURUSD", "volume"=0.1, "price"=1.2, "expiration"=1560782460)
|
||||
print(rep)
|
||||
```
|
||||
## Live data and streaming events
|
||||
@@ -290,20 +293,19 @@ def _t_streaming_events():
|
||||
print(reply)
|
||||
|
||||
|
||||
for _ in range(3):
|
||||
t = threading.Thread(target=_t_livedata, daemon=True)
|
||||
t.start()
|
||||
|
||||
for _ in range(3):
|
||||
t = threading.Thread(target=_t_streaming_events, daemon=True)
|
||||
t.start()
|
||||
t = threading.Thread(target=_t_livedata, daemon=True)
|
||||
t.start()
|
||||
|
||||
t = threading.Thread(target=_t_streaming_events, daemon=True)
|
||||
t.start()
|
||||
|
||||
while True:
|
||||
pass
|
||||
```
|
||||
|
||||
|
||||
There are only two variants of `Live socket` data. When everything is ok, the script sends candle data on close:
|
||||
There are only two variants of `Live socket` data. When everything is ok, the script sends data on candle close:
|
||||
|
||||
```
|
||||
{"status":"CONNECTED","data":[1560780120,1.12186,1.12194,1.12186,1.12191,15.00000]}
|
||||
|
||||
Reference in New Issue
Block a user