Python Forum
Trying to write a simple (but not so simple for me) trading algo
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to write a simple (but not so simple for me) trading algo
#1
Hello guys, I am new to this forum. Sorry if I am posting this at the wrong section. I am very new to Python, and previously have been using R and Matlab for data analysis. Now I am trying to do a bit different task.

The task I want to do is to have a trading algo that does the following:
Say I have some trading signals that is going to help me rank the 30 stocks in my watchlist. On the first day I will hold the top 3 from the list.
For instance, the top 3 are AAPL, MSFT, AMZN. Next period I will get a new rank, and the top 3 could be replaced by other stocks. What I want to do here is to minimize changing positions. Therefore I don't want to change any of the 3 stocks that I am holding unless they fall out of the top 4 ranking. Using my last example that I have held AAPL, MSFT, and AMZN, say next period my top 4 stocks are AMZN, MSFT, EBAY, AAPL, then I do not change my portfolio. But if the new ranking is EBAY, NFLX, AAPL AMZN, then I want to change MSFT to EBAY, since it has fallen out of my top 4.

I hope I have explained my problem clearly. I would really appriciate any advice you guys can offer me. Thanks
Reply
#2
search PyPi for packages that you can use in your code (for fetching quotes, etc.
for example: use search string 'stock ranking'
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with simple code JacobSkinner 1 229 Mar-18-2024, 08:08 PM
Last Post: deanhystad
Star Pairs Trading Simulation Kiitoos 0 200 Feb-19-2024, 08:27 PM
Last Post: Kiitoos
  How do I organize my simple ftp modules? blobdx7 3 455 Jan-05-2024, 01:23 PM
Last Post: Gribouillis
  I must be missing something simple? SLFrey 2 469 Dec-11-2023, 03:13 PM
Last Post: SLFrey
  I have a code which is very simple but still I cannot detect what's wrong with it max22 1 440 Nov-07-2023, 04:32 PM
Last Post: snippsat
  A simple problem, how best to solve it? SuchUmami 2 683 Sep-01-2023, 05:36 AM
Last Post: Pedroski55
  Simple conditional not working as expected return2sender 8 935 Aug-27-2023, 10:39 PM
Last Post: return2sender
  Simple Question - ' defined as "a". ?' Ryan012 10 1,491 May-27-2023, 06:03 PM
Last Post: Ryan012
  A simple python doubt mohamedrabeek 2 692 Mar-26-2023, 07:24 PM
Last Post: deanhystad
  what's wrong? i know this is simple davidorlow 11 1,561 Mar-15-2023, 05:14 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020