Ejemplo n.º 1
0
def tosVolTrailingStopSTUDY(symbol):
    val, times = block.get(symbol, "CUSTOM5", date_time=True)
    if val == "1.0":
        return True
    elif val == "-1.0":
        return False
    tosdb.clean_up()
Ejemplo n.º 2
0
 def tosVolTrailingStopSTUDY(self):
     val, times = self.block.get(self.ticker, "CUSTOM5", date_time=True)
     if val == "1.0":
         return "Long"
     elif val == "-1.0":
         return "Short"
     tosdb.clean_up()
Ejemplo n.º 3
0
        fout.write(' ')
        _try_write(sdata,i,10,1)                
    else:
        _try_write(mdata,i,50)
        fout.write('\t')
        _try_write(sdata,i,50)
    fout.write('\n')

    
if __name__ == '__main__':
    parser = _ArgumentParser()
    parser.add_argument('--root', help='root directory to search for the library')
    parser.add_argument('--path', help='the exact path of the library')
    args = parser.parse_args()
    if not args.path and not args.root:  
        print('error: --root or --path arg requried')
        exit(1)  
    try:
        res = tosdb.init(dllpath=args.path, root=args.root)        
    except Exception as e:
        print('error: exception during init:', str(e))
        exit(1)  
    print("+ BEGIN")
    test_marker_func('stream_snapshot_from_marker')
    test_marker_func('n_from_marker', N)
    tosdb.clean_up()
    print("+ END")
 


Ejemplo n.º 4
0
def tosDBohlc():
    intrv = ohlc.TOSDB_OpenHighLowCloseIntervals(ohlcblock, 60)
    print(intrv.get("/ES:XCME", "OPEN"))
    tosdb.clean_up()