-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix with OANDA open trades. Relay now utilizes and properly trcks…
… open trades to the maximumallowable level that OANDA supports. Changes to be committed: modified: Base/Library/JRRoanda.py modified: Extras/CodeProofs/oandaOpenTrades new file: Extras/CodeProofs/place100orders modified: Extras/CodeProofs/readMarkets
- Loading branch information
Showing
4 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Jackrabbit Relay | ||
# 2021 Copyright © Robert APM Darin | ||
# All rights reserved unconditionally. | ||
|
||
import sys | ||
sys.path.append('/home/GitHub/JackrabbitRelay/Base/Library') | ||
import os | ||
import json | ||
|
||
import JackrabbitRelay as JRR | ||
|
||
### | ||
### Main code base. Place order on exchange | ||
### | ||
|
||
relay=JRR.JackrabbitRelay() | ||
if relay.GetArgsLen() > 4: | ||
exchangeName=relay.GetExchange() | ||
account=relay.GetAccount() | ||
asset=relay.GetAsset() | ||
side=relay.GetArgs(4) | ||
amount=relay.GetArgs(5) | ||
else: | ||
print("An exchange, (sub)account, an asset, a side (buy/sell), and an amount must be provided.") | ||
sys.exit(1) | ||
|
||
u=float(amount) | ||
for i in range(100): | ||
ticker=relay.GetTicker(symbol=asset) | ||
bPrice=ticker['Ask'] | ||
sPrice=ticker['Bid'] | ||
|
||
mPrice=min(bPrice,sPrice) | ||
|
||
result=relay.PlaceOrder(pair=asset,orderType="market",action=side,amount=u,price=bPrice) | ||
print(result) | ||
u+=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters