service.terminate()

tb435225tb435225 Posts: 7
edited January 2021 in Quick Question

Hi I am trying to start a simple backtest and I am getting an error for using service.terminate(). I checked and nothing is wrong with it and there isn't any unexpected spaces or anything, so not sure why it is returning an error

Comments

  • pt555112pt555112 Posts: 2
    edited January 2021

    That is an odd one.
    You only included an image so I cannot test YOUR code.

    I must assume you have a typo or an odd character in there somewhere..

    This code worked fine for me...

    from cloudquant.interfaces import Strategy
    
    class termbug(Strategy):
    
        @classmethod
        def is_symbol_qualified(cls, symbol, md, service, account):
            return symbol == 'SPY'
    
        def on_start(self, md, order, service, account): 
            service.terminate()
    
Sign In or Register to comment.