Giter Site home page Giter Site logo

Comments (10)

Aureliano90 avatar Aureliano90 commented on September 23, 2024 4

You have to elaborate your question. Or just use the latest commit.

from futures-spot-arbitrage-okex-v5.

Aureliano90 avatar Aureliano90 commented on September 23, 2024 1

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.

panpansh avatar panpansh commented on September 23, 2024

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.

panpansh avatar panpansh commented on September 23, 2024

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.

Aureliano90 avatar Aureliano90 commented on September 23, 2024

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.

panpansh avatar panpansh commented on September 23, 2024

I have to take the time to understand I will start with that especially 🙏

from futures-spot-arbitrage-okex-v5.

panpansh avatar panpansh commented on September 23, 2024

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.

Aureliano90 avatar Aureliano90 commented on September 23, 2024

from futures-spot-arbitrage-okex-v5.

panpansh avatar panpansh commented on September 23, 2024

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.

Aureliano90 avatar Aureliano90 commented on September 23, 2024

What do you mean by "send self"?

It's just checking account settings.

from futures-spot-arbitrage-okex-v5.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.