Overall Statistics
Total Trades
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Net Profit
0%
Sharpe Ratio
0
Probabilistic Sharpe Ratio
0%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0
Beta
0
Annual Standard Deviation
0
Annual Variance
0
Information Ratio
0.309
Tracking Error
0.209
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
# region imports
from AlgorithmImports import *
import json
import time
from io import StringIO
# endregion

class DeterminedFluorescentOrangeZebra(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2022, 2, 9)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash

        self.AddUniverse(self.CoarseUniverseSelection)
        self.numDownloads = 0

    def OnData(self, data: Slice):
        pass


    '''
        Coarse universe selection
    '''
    def CoarseUniverseSelection(self, coarse):
        # Try 5 times to download the file
        for i in range(5):
            file = self.Download("https://www.dropbox.com/s/79a98o4l14bx0q9/test.txt?dl=1")
            if (file != ''):
                break
            # Failed after 5 retries
            elif (i == 4):
                self.Debug(f"{self.Time} Failed 5 times")
                return []
            
            # Wait one second and try again
            time.sleep(1)
        
        self.stock_file = json.loads(file)
        self.numDownloads += 1
        self.Debug(f"{self.Time} | {self.numDownloads} | {str(self.stock_file)}")
        

        return []