Overall Statistics
Total Trades
2
Average Win
0%
Average Loss
0%
Compounding Annual Return
-100.000%
Drawdown
39.800%
Expectancy
0
Net Profit
-30.880%
Sharpe Ratio
-7.194
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
12.605
Beta
-1540.353
Annual Standard Deviation
1.624
Annual Variance
2.636
Information Ratio
-7.201
Tracking Error
1.624
Treynor Ratio
0.008
Total Fees
$2.00
''' https://www.quantconnect.com/forum/discussion/3806/security-object-shows-067-history-shows-12

c means context to me, my replacement for 'self'
s means security_object except sometimes includes Price and sometimes not

ZSAN filtered logging below
'''

class PriceScreening(QCAlgorithm):
    def Initialize(c):
        c.SetCash(10)
        c.SetStartDate(2017,12,21)
        c.SetEndDate(  2017,12,28)
        c.AddUniverse(c.CoarseSelection)
        c.Schedule.On(c.DateRules.EveryDay(), c.TimeRules.At(9, 30), Action(c.trade))

    def CoarseSelection(c, coarse):
        coarse = [ s for s in coarse if s.Price > .60 and s.Price < .70 and s.HasFundamentalData ]
        #for s in coarse:
        #    c.Securities[s].SetDataNormalizationMode(DataNormalizationMode.Raw)  # Adjusted (default), Raw, SplitAdjusted, and TotalReturn
        for s in coarse:
            if 'ZSAN' in str(s.Symbol):
                #c.Securities[s.Symbol].SetDataNormalizationMode(DataNormalizationMode.Raw)
                c.Debug('Coarse {}   {}  prc {}   \n{}'.format(s, str(s.Symbol), s.Price, c.History([s.Symbol], 7, Resolution.Daily)))
        c.universe = [ s.Symbol for s in coarse ]
        return c.universe

    def trade(c):
        if not len(c.universe): return
        for s in c.universe:
            if not c.Securities.ContainsKey(s): continue
            c.Securities[s].SetDataNormalizationMode(DataNormalizationMode.Raw)  # Adjusted (default), Raw, SplitAdjusted, or TotalReturn
            prc = float(c.Securities[s].Price)  # What should be used instead?
            if not prc: continue
            if prc > 5:
                c.Debug('trade        {}   {}   \n{}'.format(s, prc, c.History([s], 5, Resolution.Daily)))
            else:
                c.Debug('trade        {}   {}'.format(s, prc))
            limit_prc = prc * .95
            quantity  = 1
            c.Debug('trade order {} quantity {} limit_prc {}'.format(s, quantity, limit_prc))
            c.LimitOrder(s, quantity, limit_prc)

'''
2017-12-22 00:00:00 Coarse ZSAN VXLELNXHWMSL: $0.67   ZSAN VXLELNXHWMSL  prc 0.67   
                               close    high     low    open    volume
symbol            time                                                
ZSAN VXLELNXHWMSL 2017-12-13  11.986  12.976  11.800  12.800  168676.0
                  2017-12-14  12.600  12.800  11.934  11.934   57095.0
                  2017-12-15  13.400  13.734  12.380  12.380  330689.0
                  2017-12-16  14.220  15.580  13.500  13.560  769637.0
                  2017-12-19  14.600  15.400  13.800  15.400  228957.0
                  2017-12-20  13.740  14.956  13.400  14.956  161154.0
                  2017-12-21  12.800  13.998  12.800  13.742  193489.0  <== SetDataNormalizationMode() hasn't run yet
2017-12-23 00:00:00 Coarse ZSAN VXLELNXHWMSL: $0.65   ZSAN VXLELNXHWMSL  prc 0.646   
                              close    high     low    open    volume
symbol            time                                               
ZSAN VXLELNXHWMSL 2017-12-14  0.630  0.6400  0.5967  0.5967   57095.0
                  2017-12-15  0.670  0.6867  0.6190  0.6190  330689.0
                  2017-12-16  0.711  0.7790  0.6750  0.6780  769637.0
                  2017-12-19  0.730  0.7700  0.6900  0.7700  228957.0
                  2017-12-20  0.687  0.7478  0.6700  0.7478  161154.0
                  2017-12-21  0.640  0.6999  0.6400  0.6871  193489.0
                  2017-12-22  0.670  0.6900  0.6300  0.6484  162037.0
2017-12-26 00:00:00 trade        ZSAN VXLELNXHWMSL   12.92   
                              close    high     low    open    volume
symbol            time                                               
ZSAN VXLELNXHWMSL 2017-12-19  0.730  0.7700  0.6900  0.7700  228957.0
                  2017-12-20  0.687  0.7478  0.6700  0.7478  161154.0
                  2017-12-21  0.640  0.6999  0.6400  0.6871  193489.0
                  2017-12-22  0.670  0.6900  0.6300  0.6484  162037.0
                  2017-12-23  0.646  0.6690  0.6314  0.6600   36729.0
2017-12-26 00:00:00 trade order ZSAN VXLELNXHWMSL quantity 1 limit_prc 12.274 ????
2017-12-26 00:00:00 trade        ZSAN VXLELNXHWMSL   12.92   
                              close    high     low    open    volume
symbol            time                                               
ZSAN VXLELNXHWMSL 2017-12-19  0.730  0.7700  0.6900  0.7700  228957.0
                  2017-12-20  0.687  0.7478  0.6700  0.7478  161154.0
                  2017-12-21  0.640  0.6999  0.6400  0.6871  193489.0
                  2017-12-22  0.670  0.6900  0.6300  0.6484  162037.0
                  2017-12-23  0.646  0.6690  0.6314  0.6600   36729.0
2017-12-26 00:00:00 trade order ZSAN VXLELNXHWMSL quantity 1 limit_prc 12.274
'''