Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Avoiding day trades in Robinhood.

I am new here and I don't really know where to post this. But I was wondering if Robinhood would block day trades that an algorithm would try to execute. If not, then how could I avoid day trades?

1 response
def initialize(context):  
    context.bought = []  
    context.sold = []

def before_trading_start(context, data):  
    context.bought = []  
    context.sold = []

def my_rebalance(context, data):

    #sell logic  
    if not stock in context.bought:  
        order(stock, -shares)  
        context.sold.append(stock)

    #buy logic  
    if not stock in context.sold:  
        order(stock, shares)  
        context.bought.append(stock)