Notifications
Clear all

Import Strategies from TradeStation Performance Report into Build Alpha

10 Posts
5 Users
4 Reactions
4,220 Views
Dave
 Dave
(@dave)
Reputable Member Admin
Joined: 9 years ago
Posts: 255
Topic starter  

Hey all,

I just made a quick python script (attached) that can be copy and pasted into Build Alpha's python environment. There is a video on YouTube and buildalpha.com/video that shows exactly how to use this script and import a strategy from Tradestation into Build Alpha. 

Once imported you can run the analysis techniques and add to a portfolio, etc.

If your native language does not use "," then there might be some adjustments you have to make to the code. 

As always, reach out to me via email if you have questions or difficulties.

Thanks and have a great weekend,

Dave

 
 
 
 
 


   
Mike and JSa reacted
Quote
 JJT
(@jjt)
New Member
Joined: 8 years ago
Posts: 4
 

Great addition, thanks Dave!



   
Dave reacted
ReplyQuote
 pi
(@pi)
Active Member
Joined: 8 years ago
Posts: 6
 

great stuff Dave. You may wish to send an email out to notify users - as they'll be frothing at the gills over this no doubt.



   
ReplyQuote
Dave
 Dave
(@dave)
Reputable Member Admin
Joined: 9 years ago
Posts: 255
Topic starter  

Yes, of course. will actually be sending it out tmrw or Tuesday along with updated BA.



   
ReplyQuote
(@dmo)
New Member
Joined: 7 years ago
Posts: 2
 

great stuff Dave

Cheers



   
Dave reacted
ReplyQuote
Dave
 Dave
(@dave)
Reputable Member Admin
Joined: 9 years ago
Posts: 255
Topic starter  

Hey,

Try setting intraday to False and see if it runs. If not, please add these triple quotes as seen below to the code and run again.

 

df = pd.read_csv(input_file_name,delimiter=',',index_col=2,parse_dates=True,header=None)
if df.index[-1] == "Open":
 df = df[:-1]
'''
if intraday:
 df.index = [parse(d) for d in df.index]
 df.index = [pd.to_datetime(d) for d in df.index]
else:
        df.index = [pd.to_datetime(d) for d in df.index]
'''
df['Time'] = [str(d.hour * 10000 + d.minute * 100 + d.second) if intraday else "170000" for d in df.index]
df['Results'] = [float(x.replace('(','-').replace('$','').replace(')','').replace(',','')) for x in df[6]]

 

 

If neither of those work then please email me for further assistance.

Thanks,

David



   
ReplyQuote
Dave
 Dave
(@dave)
Reputable Member Admin
Joined: 9 years ago
Posts: 255
Topic starter  

Please make sure you have Using Custom Strategies selected in the settings menu and then have loaded the file from File->Custom Strategies menu. Finally, run the simulation using built-in NQ symbol.

Thanks,

David



   
ReplyQuote
 ZH
(@zh)
New Member
Joined: 7 years ago
Posts: 4
 

I am doing exactly what you are advising but no success do you want me to send you final file?



   
ReplyQuote
Dave
 Dave
(@dave)
Reputable Member Admin
Joined: 9 years ago
Posts: 255
Topic starter  

Yes



   
ReplyQuote
Dave
 Dave
(@dave)
Reputable Member Admin
Joined: 9 years ago
Posts: 255
Topic starter  

User error as symbol needs to be all upper case to match the Build Alpha symbols. I have added logic to prevent user from entering lower case symbols in the future in this updated script.

To read in custom strategy while using custom data please use custom data symbol such as

symbol = #U1

Thanks,

David



   
ReplyQuote
Share: