Jump to content
Sign in to follow this  
PuneetTewani

Script for automated Buy/Sell using Excel

Recommended Posts

PuneetTewani

I am trying to automate my trading. I have used NEST RTD so that I can receive live data in excel. I want to compute average of 14 cells dynamically and the if average is greater than a particular number(for ex: 90), We buy a script and parameters for buy (i.e. Quantity, Limit Price) could be defined from excel itself.

 

 

Share this post


Link to post
Share on other sites
iamtheky

show the excel document and/or the code you have currently.  You will find lots of resistance if you expect us to code something while you have thought exercises.

Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
Earthshine

why can't you use VBA inside of your Excel sheet and automate it that way? 


My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
PuneetTewani

I went through some articles on internet but isn't aware how to inject dll into system from VBA.

Attaching the excel file that is being used in current context. The cell B2 is tracked and its value is recorded on cell V2 and so on at time interval of 3 minutes and I am trying to calculate average of 14 relevant cells(which keeps on changing as new rows are recorded)  in cell W2 and if W2 > V2 inject a buy dll into system. Please also help in how to pass parameters to dll from excel.

 

Thanks in advance.

Default MW1.xlsm

Share this post


Link to post
Share on other sites
Earthshine

you really need to search google. 

https://msdn.microsoft.com/en-us/library/office/bb687915.aspx#sectionSection0

 

When you have Excel open, press ALT-F11 keys and the VBA editor shows up.

Next, use Insert from the menu and add a new module

You can now create custom VBA functions now and call your DLL all you want.

you can attach the module to cells and whatnot, just like a formula

Edited by Earthshine
  • Like 1

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.