JulyIghor / QtBitcoinTrader

Secure multi crypto exchange trading client
https://sourceforge.net/projects/bitcointrader/
732 stars 376 forks source link

Group is stopped and the function is still running #258

Closed DrrMrr closed 5 years ago

DrrMrr commented 5 years ago

Hi,

Version: 1.40.42 - downloaded from sourceForge System: Windows 7 Pro

I have written three scripts:

  1. main - checks if there is file changed. If it this then it starts Buy or Sell Group
  2. sell - keeps on running until the sell has been completed
  3. buy - keeps on running until the buy has been completed

At the beginning three groups has to be made Main, Buy and Sell. Then you start Main which ckecks the file trader_signal.txt. If there is a "SELL" string in it Sell group will be started and then stopped if there is no BTC balance. That goes also for BUY signal. BUT, the group stops and trader.timer keeps on running in stopped group - trader.timer(5, "sell_if_you_can()"); Like the thread that executes function in same interval becomes an orphan.

Can you please check why is that so. Is this a bug or something else.

trader-buyer.zip

Thank you and best regards Damjan

JulyIghor commented 5 years ago

BUT, the group stops and trader.timer keeps on running in stopped group - trader.timer(5, "sell_if_you_can()");

Can you please tell how group was stopped? You pressed stop button or via other script?

DrrMrr commented 5 years ago

It was stopped within group "Sell" or "Buy". If there is no balance then it stops, but the process keeps on running even though the group is stopped. But the group "Sell" or "Buy" was started from group "Main."

JulyIghor commented 5 years ago

Are you sure that Main was stopped?

DrrMrr commented 5 years ago

Main is not stopped. I'm stopping just Buy or Sell at this time. Main has infinite check every 5 minutes if file was changed. Then I start Buy or Sell which depends from the text in file. If Sell is started and there is no more balance then script in Sell group stops the group Sell. So it works also in Buy group.

I want to stop the group Buy or Sell within the same group.

JulyIghor commented 5 years ago

I can't reproduce it. Maybe your Main script is constantly starting group Sell that is stopping itself instantly, but you get function executed. Can you verify it?

DrrMrr commented 5 years ago

I will check today once again. And will bo more specified. The interesting is that the group is stoped within the same group and log output I can see that only function that was previously triggered every 5 seconds kept on running every 5 seconds.

DrrMrr commented 5 years ago

Hi,

So I've made the video with log files.

trader-video.zip

If you can see I started only main group which then starts buy group, because it gets buy signal. Because I don't have any USDT it should stop. Then if you look at the log file for Buy group you can see, that the start_main function is finished and never started again. After that only function buy_if_you_can() is started every 5 seconds recursively. I don't understand why this function in Buy group is keep on running. I think still this is a bug and the function somehow doesn't know that it should stop, because the group was stopped.

I hope this details were helpful.

Best regards Damjan

JulyIghor commented 5 years ago

Thanks. It will be fixed in upcoming update.

JulyIghor commented 5 years ago

Fixed in v1.40.43