예제 #1
0
    nrows = tms21.shape[0]
    start = tms21.index[0]
    end = tms21.index[-1]
    
    iStart = tms21.index.get_loc(end)-1
    iEnd = tms21.index.get_loc(end)
    
    # Update gainAhead
    tms21.iloc[iStart,tms21.columns.get_loc('gainAhead')] = sst1.iloc[iStart,sst1.columns.get_loc('gainAhead')]
    
    tms21 = tradeRisk.update_tms_trade_dec(tms21, iStart, iEnd, y_validate)
    
    print(tms21.tail(4))
        
    dSet.save_csv(system_directory,
                  system_name,
                  'TMS_Part2',
                  'dbd',
                  tms21
                  )
    
    system_dict['pivotDate']=tradeDate
    sysUtil.save_dict(system_name, 'system_dict', system_dict)
    
    plotIt.plot_equity_drawdown(issue, tms21)
    
    plotIt.plot_CAR25_close(issue, tms21)
    
    plotTitle = "Safe-f for " + issue
    plotIt.plot_v1(tms21['safef'][:-2], plotTitle)
예제 #2
0
    sysUtil.save_dict(system_name, 'tms_dict', tms_dict)

    # Work with index instead of dates
    start = sst.index[0 + windowLength]
    iStart = sst.index.get_loc(start)
    print(iStart)
    iEnd = sst.index.get_loc(end)
    print(iEnd)

    printDetails = False

    tradeRisk.get_safef_car25(sst, iStart, iEnd, tms_dict)

    print(sst.tail(3))
    sst.reset_index(level='Date', inplace=True)
    print(sst.tail(3))
    #    dSet.save_csv(system_directory,
    #                  system_name,
    #                  'TMS_Part1',
    #                  'dbd',
    #                  sst
    #                  )

    plot_tms = sst.set_index(pd.DatetimeIndex(sst1['Date']))
    plot_tms = plot_tms.drop('Date', axis=1)
    plotTitle = "Safe-f for " + issue
    plotIt.plot_v1(plot_tms['safef'][:-2], plotTitle)
    plotTitle = "CAR25 for " + issue
    plotIt.plot_v1(plot_tms['CAR25'][:-2], plotTitle)