Overall Statistics
Total Trades
9
Average Win
0.01%
Average Loss
0%
Compounding Annual Return
0.224%
Drawdown
0.000%
Expectancy
0
Net Profit
0.012%
Sharpe Ratio
1.511
Probabilistic Sharpe Ratio
55.357%
Loss Rate
0%
Win Rate
100%
Profit-Loss Ratio
0
Alpha
0.001
Beta
0.001
Annual Standard Deviation
0.001
Annual Variance
0
Information Ratio
-0.871
Tracking Error
0.675
Treynor Ratio
2.723
Total Fees
$1.36
Estimated Strategy Capacity
$7100.00
Lowest Capacity Asset
NEOUSD E3
class VirtualVioletBaboon(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2021, 4, 25)  # Set Start Date        self.SetStartDate(2020,5, 15)
        #self.SetEndDate(2020,6,1)
        self.SetCash(100000)  # Set Strategy Cash
        self.SetBrokerageModel(BrokerageName.Bitfinex, AccountType.Cash)
        self.crypto = self.AddCrypto('NEOUSD', Resolution.Minute, Market.Bitfinex)
        self.nextSell = 0
        self.sell = 0
        


    def OnData(self, data):
        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
            Arguments:
                data: Slice object keyed by symbol containing the stock data
        '''
        symbol = 'NEOUSD'
        margin = 0.085
        if self.sell:
            self.sell = 0
            limit = self.LimitOrder(str(symbol), -1 , self.nextSell)#,  str(orderEvent.FillPrice))
                
        if not self.Portfolio[symbol].Invested:
            self.Debug("Not invested in " + str(symbol))

            sell = round(data[symbol].Close*(1+margin),5)
            self.nextSell = sell
            order = self.MarketOrder(symbol, 1, False, str(sell))
            self.sell = 1
    

        
        
    def OnOrderEvent(self, orderEvent):
        if orderEvent.Status != (OrderStatus.Filled or orderStatus.Liquidated):
            self.Debug("Order Event" + str(orderEvent))
            return
        if self.LiveMode:
            self.Debug("New Order Filled " + str(orderEvent))


    
    def OnSecuritiesChanged(self, changes):
        if self.LiveMode:
            self.Debug("Portfolio change :" + str(changes))