Comments (10)
You have to elaborate your question. Or just use the latest commit.
from futures-spot-arbitrage-okex-v5.
Thanks for reporting. This is really an exotic issue. It comes down to how multiprocessing
create child processes in different OS. In Linux the child processes are forked from the main one, so is the event loop. It causes the event loops in different processes to mix up.
Once it works, the program will manage your position on its own, assuming it is already hedged. You can close your position manually at your wish. Or the program will close it when it isn't profitable.
from futures-spot-arbitrage-okex-v5.
thank you for your precise answer. so it doesn't block anything in theory or doesn't miss anything by not expecting it? how do I really know if I'm not going to wait forever? :) can there be a way to solve this different management in order to obtain a uniform behavior so as not to have any surprises?
from futures-spot-arbitrage-okex-v5.
Hey what is the problem about fetch_records_lock variable access please ? (I dont know python by default). This one is in order to avoid starting another record_ticker process ? maybe I dont how it is managed.
Then what do you think to start it as service with sys.argv[1] == '--service' ?
do we agree that in this way I could issue orders from another python instance and everything will happen on its own ?
what is the strategy path please ?
def main_menu(accountid: int):
"""主菜单
:param accountid: 账号id
"""
fetch_records_lock = False # ?
try:
assert isinstance(accountid, int)
fprint(f'{accountid=}')
Monitor = monitor.Monitor(coin='BTC', accountid=accountid)
loop = asyncio.get_event_loop()
loop.run_until_complete(gather(Monitor.check_account_level(), Monitor.check_position_mode()))
def fetch_records():
if not fetch_records_lock: # ?
record_process = multiprocessing.Process(target=record.record_ticker)
record_process.start()
record_process.join(0.2)
fetch_records_lock = True # ?
else:
print('fetch ticker already started')
if len(sys.argv) > 1 and sys.argv[1] == '--service':
fetch_records()
else:
while (command := input(main_menu_text)) != 'q':
if command == '1':
monitor_all(accountid)
elif command == '2':
crypto_menu(accountid)
elif command == '3':
funding_menu(accountid)
elif command == '4':
account_menu(accountid)
elif command == '5':
fetch_records()
elif command == 'q':
break
else:
print(wrong_command)
finally:
if 'process' in locals():
process.kill()
trading_data.Stat.clean()
monitor.Monitor.clean()
from futures-spot-arbitrage-okex-v5.
You can add the service yourself. As long as a Python interpreter is recording, others use the same database. I don't know what you mean by strategy path.
from futures-spot-arbitrage-okex-v5.
I have to take the time to understand I will start with that especially 🙏
from futures-spot-arbitrage-okex-v5.
when I start the monitor process on windows, I cant "Input q to abort" with the last update. I have to Ctrl+C to exit.
Process Process-1:
Process Process-2:
Traceback (most recent call last):
Traceback (most recent call last):
from futures-spot-arbitrage-okex-v5.
from futures-spot-arbitrage-okex-v5.
can you help me to send "self" here please ?
https://github.com/panpansh/Futures-Spot-Arbitrage-OKEx-V5/blob/main/menu.py#L222
is it monitoring BTC positions only here ?
https://github.com/panpansh/Futures-Spot-Arbitrage-OKEx-V5/blob/main/menu.py#L215
do you have a discord or something like that ?
from futures-spot-arbitrage-okex-v5.
What do you mean by "send self"?
It's just checking account settings.
from futures-spot-arbitrage-okex-v5.
Related Issues (16)
- 你好,我用了你的代码,非常棒,输入币的时候,有个问题,可以解答一下吗?不胜感激 HOT 23
- 资金汇率 和资金费率 计算问题 HOT 1
- Parameter accountid is not passed when creating FundingRate object HOT 1
- Questions on src/monitor.py HOT 1
- local variable 'json_res' referenced before assignment HOT 4
- Move away from MongoDB
- Project refactor and overhaul HOT 5
- Telegram Group Chat HOT 1
- 谢谢,大佬,还有一个问题想请教一下,就是我点击记录行情的时候,总是报错,是因为我的timeout设置的过小吗? HOT 7
- 新版本执行后异常报错 HOT 3
- 点击记录行情,pymongo报连接池异常 HOT 2
- Cross Margin ? HOT 3
- 关于数据库的问题 HOT 3
- looking fine HOT 1
- coroutine 'record' was never awaited HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from futures-spot-arbitrage-okex-v5.