コード例 #1
0
ファイル: test_strategytest.py プロジェクト: eddy668/rts
    def execute_results(self):
        import os
        import shutil
        SymbolsFile = ''
        ExpirationsFile = ''

        if os.path.isfile("Z:\\jm\\My Python\\Remote\\listener\\short.txt"):
            os.remove("Z:\\jm\\My Python\\Remote\\listener\\short.txt")
            SymbolsFile = 'inputs\\SymbolsShort.txt'
            ExpirationsFile = 'inputs\\ExpirationsShort.txt'
            if os.path.isfile(
                    'Z:\\jm\\My Python\\Remote\\Input\\SymbolsShort.txt'):
                shutil.copyfile(
                    'Z:\\jm\\My Python\\Remote\\Input\\SymbolsShort.txt',
                    'inputs\\SymbolsShort.txt')
            if os.path.isfile(
                    'Z:\\jm\\My Python\\Remote\\Input\\ExpirationsShort.txt'):
                shutil.copyfile(
                    'Z:\\jm\\My Python\\Remote\\Input\\ExpirationShort.txt',
                    'inputs\\ExpirationShort.txt')

        if os.path.isfile("Z:\\jm\\My Python\\Remote\\listener\\main.txt"):
            os.remove("Z:\\jm\\My Python\\Remote\\listener\\main.txt")
            SymbolsFile = 'inputs\\SymbolsMain.txt'
            ExpirationsFile = 'inputs\\ExpirationsMain.txt'
            if os.path.isfile(
                    'Z:\\jm\\My Python\\Remote\\Input\\SymbolsMain.txt'):
                shutil.copyfile(
                    'Z:\\jm\\My Python\\Remote\\Input\\SymbolsMain.txt',
                    'inputs\\SymbolsMain.txt')
            if os.path.isfile(
                    'Z:\\jm\\My Python\\Remote\\Input\\ExpirationsMain.txt'):
                shutil.copyfile(
                    'Z:\\jm\\My Python\\Remote\\Input\\ExpirationsMain.txt',
                    'inputs\\ExpirationsMain.txt')

        if os.path.isfile("Z:\\jm\\My Python\\Remote\\listener\\run.txt"):
            os.remove("Z:\\jm\\My Python\\Remote\\listener\\run.txt")
            SymbolsFile = 'inputs\\Symbols.txt'
            ExpirationsFile = 'inputs\\Expirations.txt'

        if len(SymbolsFile) == 0:
            print('no short/main/run file found')

        if len(SymbolsFile) > 0:
            import mytools
            datetime14 = mytools.mystrings.ConvertDatetime14()
            print(datetime14)
            #outputfilepath = 'C:\\Documents and Settings\\jmalinchak\\My Documents\\My Python\\Active\\output\\' + datetime14 + '.csv'
            import strategytest
            c = strategytest.calendarspreadslive(SymbolsFile, ExpirationsFile,
                                                 'downloads', 'output')

            outputfilepath = strategytest.OutputFilePathString

            shutil.copyfile(
                outputfilepath,
                'Z:\\jm\\My Python\\Remote\\output\\' + datetime14 + '.csv')
            return c
コード例 #2
0
ファイル: test_strategytest.py プロジェクト: rtstock/rts
 def execute_results(self):
     import os
     import shutil
     SymbolsFile = ''
     ExpirationsFile = ''
     
     
     if os.path.isfile("Z:\\jm\\My Python\\Remote\\listener\\short.txt"):
         os.remove("Z:\\jm\\My Python\\Remote\\listener\\short.txt") 
         SymbolsFile = 'inputs\\SymbolsShort.txt'
         ExpirationsFile = 'inputs\\ExpirationsShort.txt'
         if os.path.isfile('Z:\\jm\\My Python\\Remote\\Input\\SymbolsShort.txt'):
             shutil.copyfile('Z:\\jm\\My Python\\Remote\\Input\\SymbolsShort.txt', 'inputs\\SymbolsShort.txt')
         if os.path.isfile('Z:\\jm\\My Python\\Remote\\Input\\ExpirationsShort.txt'):
             shutil.copyfile('Z:\\jm\\My Python\\Remote\\Input\\ExpirationShort.txt', 'inputs\\ExpirationShort.txt')
     
     if os.path.isfile("Z:\\jm\\My Python\\Remote\\listener\\main.txt"):
         os.remove("Z:\\jm\\My Python\\Remote\\listener\\main.txt") 
         SymbolsFile = 'inputs\\SymbolsMain.txt'
         ExpirationsFile = 'inputs\\ExpirationsMain.txt'
         if os.path.isfile('Z:\\jm\\My Python\\Remote\\Input\\SymbolsMain.txt'):
             shutil.copyfile('Z:\\jm\\My Python\\Remote\\Input\\SymbolsMain.txt', 'inputs\\SymbolsMain.txt')
         if os.path.isfile('Z:\\jm\\My Python\\Remote\\Input\\ExpirationsMain.txt'):
             shutil.copyfile('Z:\\jm\\My Python\\Remote\\Input\\ExpirationsMain.txt', 'inputs\\ExpirationsMain.txt')
     
     if os.path.isfile("Z:\\jm\\My Python\\Remote\\listener\\run.txt"):
         os.remove("Z:\\jm\\My Python\\Remote\\listener\\run.txt") 
         SymbolsFile = 'inputs\\Symbols.txt'
         ExpirationsFile = 'inputs\\Expirations.txt'
         
     if len(SymbolsFile) == 0:
         print('no short/main/run file found')
         
     if len(SymbolsFile) > 0:
         import mytools
         datetime14 = mytools.mystrings.ConvertDatetime14()
         print(datetime14)
         #outputfilepath = 'C:\\Documents and Settings\\jmalinchak\\My Documents\\My Python\\Active\\output\\' + datetime14 + '.csv'
         import strategytest
         c = strategytest.calendarspreadslive(SymbolsFile,
                                          ExpirationsFile,
                                          'downloads',
                                          'output')
                                          
         outputfilepath = strategytest.OutputFilePathString
         
         shutil.copyfile(outputfilepath, 'Z:\\jm\\My Python\\Remote\\output\\'+ datetime14 + '.csv')
         return c
コード例 #3
0
ファイル: test_strategytest2.py プロジェクト: eddy668/rts
SymbolsFile = 'inputs\\SymbolsShort.txt'
ExpirationsFile = 'inputs\\ExpirationsShort.txt'

if os.path.isfile("Z:\\jm\\My Python\\Remote\\listener\\main.txt"):
    os.remove("Z:\\jm\\My Python\\Remote\\listener\\main.txt")
    SymbolsFile = 'inputs\\SymbolsMain.txt'
    ExpirationsFile = 'inputs\\ExpirationsMain.txt'

if os.path.isfile("Z:\\jm\\My Python\\Remote\\listener\\run.txt"):
    os.remove("Z:\\jm\\My Python\\Remote\\listener\\run.txt")
    SymbolsFile = 'inputs\\Symbols.txt'
    ExpirationsFile = 'inputs\\Expirations.txt'

if len(SymbolsFile) == 0:
    print('no short/main/run file found')

if len(SymbolsFile) > 0:
    import mytools
    datetime14 = mytools.mystrings.ConvertDatetime14()
    print(datetime14)
    outputfilepath = 'C:\\Documents and Settings\\jmalinchak\\My Documents\\My Python\\Active\\output\\' + datetime14 + '.csv'
    import strategytest
    strategytest.calendarspreadslive(
        'C:\\Documents and Settings\\jmalinchak\\My Documents\\My Python\\Active\\downloads',
        outputfilepath, SymbolsFile, ExpirationsFile)

    shutil.copyfile(
        outputfilepath,
        'Z:\\jm\\My Python\\Remote\\output\\' + datetime14 + '.csv')
コード例 #4
0
ファイル: test_strategytest2a.py プロジェクト: rtstock/rts
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 14 11:52:03 2014

@author: jmalinchak
"""

import strategytest
o = strategytest.calendarspreadslive()
fn = o.OutputFilePathString
import os
print('heres your file: ' + os.getcwd() + '\\' + fn)
コード例 #5
0
ファイル: test_strategytest2.py プロジェクト: rtstock/rts
SymbolsFile = 'inputs\\SymbolsShort.txt'
ExpirationsFile = 'inputs\\ExpirationsShort.txt'

if os.path.isfile("Z:\\jm\\My Python\\Remote\\listener\\main.txt"):
    os.remove("Z:\\jm\\My Python\\Remote\\listener\\main.txt") 
    SymbolsFile = 'inputs\\SymbolsMain.txt'
    ExpirationsFile = 'inputs\\ExpirationsMain.txt'

if os.path.isfile("Z:\\jm\\My Python\\Remote\\listener\\run.txt"):
    os.remove("Z:\\jm\\My Python\\Remote\\listener\\run.txt") 
    SymbolsFile = 'inputs\\Symbols.txt'
    ExpirationsFile = 'inputs\\Expirations.txt'
    
if len(SymbolsFile) == 0:
    print('no short/main/run file found')
    
if len(SymbolsFile) > 0:
    import mytools
    datetime14 = mytools.mystrings.ConvertDatetime14()
    print(datetime14)
    outputfilepath = 'C:\\Documents and Settings\\jmalinchak\\My Documents\\My Python\\Active\\output\\' + datetime14 + '.csv'
    import strategytest
    strategytest.calendarspreadslive('C:\\Documents and Settings\\jmalinchak\\My Documents\\My Python\\Active\\downloads',
                                     outputfilepath,
                                     SymbolsFile,
                                     ExpirationsFile)
    
    
    shutil.copyfile(outputfilepath, 'Z:\\jm\\My Python\\Remote\\output\\'+ datetime14 + '.csv')