I'm new to Quantconnect and I'm having a very hard time understanding the API. I tried to create a trading bot in Python to execute trades on GDAX 24/24 on BTC/EUR, ETH/EUR, BCH/EUR.

My strategy is to trade like this :

  • Use the Heikin Ashi candle on a 4h timeframe
  • If the previous Heikin Ashi candle is green and the last candle is red => create a sell limit order (with 50% of the holdings) with value = current_price + 0.0001
  • If the previous Heikin Ashi candle is red and the last candle is green => create a buy limit order (with 50% of the holdings) with value = current_price - 0.0001
I understood that I need to :
  • Create a 4-hour consolidator: consolidator = QuoteBarConsolidator(timedelta(hours = 4))
  • Create a HeikinAshi using the constructor:  self.heikin_ashi = HeikinAshi(name) 
  • Register the indicator: self.RegisterIndicator("BTCEUR", self.heikin_ashi, consolidator)
But after trying different ways it doesn't work.. I don't know how to orchestrate my code. Can someone please help ? :) 

Many thanks !

Guillaume