Python - fix bug in existing package by using percentage value from config (documented bug)
€8-30 EUR
Cancelled
Posted almost 5 years ago
€8-30 EUR
Paid on delivery
Fix 3 bugs in [login to view URL]
a) with stop loss value.
In case stop loss is higher than base price (base_price) of created order buy, error occurs.
Exception: Failed: invalid_arguments
Scenario to reproduce:
set_sl_price 15000
set_contract_amount 10
set_num_orders 10
set_price_distance 10
set_base_price 10000
create_ladder
start_update
Note: current price is 10100
Solution to implement: set_sl_price has to be calculated automatically with percentage from config/parameter.
e.g
get price of lowest buy order, get percentage from config e.g 10%
calculate price for SL price, update config (set_sl_price)
simulation: last order buy: 10555.0
percentage 10%
SL price should be: 10555.0 - 10% (1055.5) = 9499.5
[2019-07-03 00:21:19,590] [INFO] Credentials Verified
DeriShell> set_sl_price 15000
[2019-07-03 00:21:43,920] [INFO] Updated Stop Loss Price to: 30.0
DeriShell> set_contract_amount 10
[2019-07-03 00:21:43,939] [INFO] Updated number of contracts to: 10
DeriShell> set_num_orders 10
[2019-07-03 00:21:43,944] [INFO] Updated number of orders to: 10
DeriShell> set_price_distance 10
[2019-07-03 00:21:43,948] [INFO] Updated price difference to: 10.0
DeriShell> fill_basePrice_askPrice
Filling base price with: 10655.0
[2019-07-03 00:21:44,001] [INFO] Updated base price to: 10655.0
DeriShell> create_ladder
[2019-07-03 00:21:44,003] [INFO] Setup initial ladder
[2019-07-03 00:21:44,190] [INFO] Placing Buy Order for 10 contracts at 10645.0
....
[2019-07-03 00:21:46,203] [INFO] Placing Buy Order for 10 contracts at 10555.0
[2019-07-03 00:21:46,460] [INFO] Placing SL Sell Order for 100 contracts at 15000.0
Traceback (most recent call last):
File "[login to view URL]", line 225, in <module>
File "[login to view URL]", line 157, in do_create_ladder
TradeManager.setup_inital_ladder()
File "\managers\[login to view URL]", line 57, in setup_inital_ladder
order = TradeManager.create_sl_sell_order(ConfigManager.get_config().stopLossPrice, ConfigManager.get_config().numOfOrders * ConfigManager.get_config().contractSize)
File "\managers\[login to view URL]", line 36, in create_sl_sell_order
order = client.sell_stop_market_order(ConfigManager.get_config().tradeInsturment, amount, price)
File "c:\util\[login to view URL]", line 168, in sell_stop_market_order
return [login to view URL]("/api/v1/private/sell", options)
File "c:\util\[login to view URL]", line 35, in request
raise Exception("Failed: " + json["message"])
Exception: Failed: invalid_arguments
b) when reset is executed and some existing order introduce manually is in place, sometimes this fails:
DeriShell> close_positions
TradeManager.close_all_positions()
File "c:\managers\[login to view URL]", line 96, in close_all_positions
[login to view URL](ConfigManager.get_config().tradeInsturment, x['size'], 99999, False, "")
File "c:\util\[login to view URL]", line 128, in buy
return [login to view URL]("/api/v1/private/buy", options)
File "c:\util\[login to view URL]", line 35, in request
raise Exception("Failed: " + json["message"])
Exception: Failed: invalid_quantity``
Reproduce: create manually one order, this will get out of synch.
c) when reset command is executed, the SL order is not cleared properly but hangs in remote server,
Hello
How are you
i have full time and I can start to work immediately
Please contact me and do let us discuss about your project
Thanks for your posting
⭐Hello⭐
My name's MingQi, Professional Full-Stack Developer with 7 years of experience.
After reading your description carefully, I have convinced that this project will be completed in time perfectly as you want.
Expertise in Python.
Please check my profile page and ⭐⭐⭐Golden Review ⭐⭐⭐ from clients.
I have my idea for implementing this project, which will be shared in private chat.
Once you select me, I will do my best, which I will deliver on time and budget.
I can make your all ideas wonderfully with High quality, affordable and work until satisfaction.
Thank you.
Hi there.
I am very interested in your proposal.
I can instantly help you with your starting project with a successful completion.
As a professional Python developer, I ensure for a perfect ongoing project.
I am sure that I can help you
Looking forward to meeting you on chat.
Regards
Hello.
I have just read your proposal in detail.
I am very interested in your project.
I have experienced this kind of job in our life.
I have entered this internet a few days ago, so I don't want a high budget and want to show my skill!
If you check me, I do my best for you and I think you can get a good feeling.
Thank you for seeing my bid.
Best regards!