Percentage Gap/Moves

How could I filter for tickers that have gapped up/down over a certain percentage.

And so I guess if you can filter by percentage move, then I would also be able to calculate something for example: 4 green days in a row up %60 from last red day.

Any tips appreciated, new to this, and looking forward to developing my strategys.


  • ptunneyptunney Posts: 246


    Hello again, you have not stated your experience with Python. My first advice would be to take an online Python course.

    Python is an extremely easy to learn programming language and, as it is one of the top programming languages in the world, will benefit you in many ways that have absolutely nothing to do with CloudQuant.

    In reference to your question.. You will want to pull the bar data for the last four days for a symbol, Calculate the percent change between the open each day vs the close the for the last 4 days, if all 4 are up flag it as a potential.

    But you state that you also want to check the percent change since the last red day, which may not have been 4/5 days ago, so you will have to decide how many days you want to go back and then scan those days to find when the last red day was and store that close price (ready for the open today).

    Then (in on_trade) when this mornings open rolls around, you check that a) it is up and that b) it is up 60% on the previous red day.

    In CloudQuant all 8800+ US Equities are available so you can do the initial scan in is_symbol_qualified (which is called once per symbol), only letting through those symbols that meet your prerequisites (and store the info you need for each symbol).

    Then in on_trade, once the open is set, you can do your secondary test (is it up 60% since previous red) and if true, take whatever action your require.

    This method of planning out your logic in 'psuedo code' is the best way for a beginner to learn to code. You then work out how to achieve each part in code and the assembled code (hopefully) does exactly what you want!

    Customer Success Manager

Sign In or Register to comment.