AdoNunes / DiscordAlertsTrader

BSD 3-Clause "New" or "Revised" License
45 stars 13 forks source link

Will this package Run in Visual Studio Code Python 3.8? #7

Closed sinsinnati closed 1 year ago

sinsinnati commented 1 year ago

Having an issue. I am using Visual Studio Code with Python 3.8. When I navigate to the DiscordAlertsTrader directory and type in the terminal: DiscordAlertsTrader

It generates the following error:

DiscordAlertsTrader : The term 'DiscordAlertsTrader' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again. At line:1 char:1

Thanks!

AdoNunes commented 1 year ago

did you do pip install -e . from the package folder? Are you in the correct env? in VSC try running gui.py

sinsinnati commented 1 year ago

Hi - thank you for responding so quickly. I did install okay...pip install -e . installed everything. When I run gui.py it opens but a few seconds later closes here is the output in the terminal:

gui_generator.py:29: RuntimeWarning: invalid value encountered in double_scalars values_s = [str(round(v, decim)) if v %1 else str(round(v)) for v in values] 2 3 4 5

then closes.

AdoNunes commented 1 year ago

Yeah for some reason when running yhe first times it does that. Try running it a few times and see if it works. If not I will reinstall it in a clean env in case some last update broke it Let me know

On Fri, Jun 16, 2023, 12:28 PM sinsinnati @.***> wrote:

Hi - thank you for responding so quickly. I did install okay. When I run gui.py it opens but a few seconds later closes here is the output in the terminal:

gui_generator.py:29: RuntimeWarning: invalid value encountered in double_scalars values_s = [str(round(v, decim)) if v %1 else str(round(v)) for v in values] 2 3 4 5

then closes.

— Reply to this email directly, view it on GitHub https://github.com/AdoNunes/DiscordAlertsTrader/issues/7#issuecomment-1594950214, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEILW3RMGWIDIXX6GI6VW7TXLSCSPANCNFSM6AAAAAAZJM6CFI . You are receiving this because you commented.Message ID: @.***>

sinsinnati commented 1 year ago

Re-ran gui.py a couple more times and now it stays open and is receiving alerts. In the terminal it does keep generarting this, even though the gui appears to be working:

\gui_generator.py:29: RuntimeWarning: invalid value encountered in double_scalars values_s = [str(round(v, decim)) if v %1 else str(round(v)) for v in values]

Any idea why that keeps popping up?

Thanks

AdoNunes commented 1 year ago

it is just a warning right? Might be a nan, but not sure why you have a nan. Could you click on update button in the portfolio tab and see if it pops up and then also in analysts portfolio tab.

The only thing I did recently was to set remove_zero to False: on line 37 change remove_zero=True


  ``
sinsinnati commented 1 year ago

It's just a warning and was wondering about it. I changed the line 37 value to True. It appears when I click on Analysts Portfolio and Analysts Stats. Maybe it's because I no longer have these analysts in my config.ini? It does not occur when I click on "update" on the "Portfolio" tab or the specific channel tab. Thanks again for all your help...great work here.

AdoNunes commented 1 year ago

the warning comes from trying to reformat the numbers for the gui and probably there is a nan or inf... unless you changed the analysts' portfolio name in the config you should have the same portfolio. I usually push the portfolio at the end of the day so I have version control and also so users can see which trader to follow based on past performance

sinsinnati commented 1 year ago

Okay, I left the portfolio as is, but still the same. It's okay maybe a nan or inf somewhere in it. I downloaded this via the "Download" button on the <>Code section, so I'm assuming that's the latest. When do you think you will have the Webull Functionality in place? I've used Ted Chou's github Webull API and it works well. I'm sure you checked that out. I know how to code all the order functions of it by now, as well.

AdoNunes commented 1 year ago

I started with the webull class but it only lets me trade during open hours, so it is a bit hard to find time. yeah also using Ted's api. Not sure how well webull will work, the package also gathers quotes from open trades every 5 sec. For now etrade seems to have cash accounts so no day trade limits for port under 25k

sinsinnati commented 1 year ago

Yeah, it isn't the greatest API..so limited and only during open hours. I figured out how to do bracket OCO orders via code, but it's just not the same as live P&L tracking. Hope it gets better asap. So are you saying that e-trade allows unlimited day trades with a cash account? I thought one had to go offshore like CMEG to do this. If I am understanding you correctly, that's awesome. Do you know if it would include e-trade pro or like real-time data / quotes etc.?

AdoNunes commented 1 year ago

For all I know with webull OCO is limited to a PT and SL. Day trading minimum balance is only for margin accounts, for cash accounts like webull, robin, etc there is no minimum, turns out etrade also has cash accounts and I probably opened a cash one. I ve been trading with my package and so far no issues or restrictions. Real time data is as good as TDA and also free. Many of the package users are on etrade

sinsinnati commented 1 year ago

I have had a TDA acct for years, but never signed up for the API. It looks like Schwab is taking forever to open the API access back up. Have you heard of any new dates aside from what's online?

By the way, I resolved the "gui_generator.py:29: RuntimeWarning: invalid value encountered in double_scalars values_s = [str(round(v, decim)) if v %1 else str(round(v)) for v in values]" issue I had:

  1. Added "import math"
  2. Line 29 in gui_generator updated:

Original Code: values_s = [str(round(v, decim)) if v %1 else str(round(v)) for v in values] New Code: values_s = [str(round(v, decim)) if v % 1 else str(round(v)) for v in values if not math.isnan(v) and not math.isinf(v)]

Sent you an email.

Thanks!

AdoNunes commented 1 year ago

awesome, thanks! I have pushed the changes.

That's the last TDA told me: "We are aiming to have our endpoint live this summer with a full release scheduled for winter of 2023."