Python installation for trading

UberMachine

Well-Known Member
#11
@ubermachine, thanks for this great initiative regarding Python. A lot of traderji members will benefit from this.

It seems as if you have a programming background. Could you please tell what kind of programming are you familiar with ?
Can we somehow use TA-lib with SQL server database as well ?

Best regards.
Thanks. I am a self-taught full time trader with my own website. I am decent at the python data analysis toolbox.

You can use TA-lib with SQL server data, though complicated.
I believe you have your data in SQL server. If this is the case and you have all the rights, its possible.
All you need is a just a loader (would do this in a few days) to load the necessary data
 

cloudTrader

Well-Known Member
#12
Why TA-Lib installation?

Warning: I don't know technical analysis

We are going to simulate charts in TA-lib so that machine can pick the patterns and generate trades (quite ambitious)
So, say you do trade on breakout. I believe you would be doing the following
  1. Watch a few charts
  2. Wait for the breakout signal
  3. Place a trade based on the signal
If this is the workflow, then this could be automated to find the patterns and generate trade signals.
It could also help us get an understanding of whether technical analysis really works
@UberMachine ,

I really liked to work upon this concept mechanically but due to non-technical background could only rely on my discretion in trading and only employing manual decision making. Very nice to go through this thread by you after the thread started by ncube on Pair Trading through Python.
 
Last edited:

trendtrade

niftytrader12
#13
@ubermachine, thanks for this great initiative regarding Python. A lot of traderji members will benefit from this.

It seems as if you have a programming background. Could you please tell what kind of programming are you familiar with ?
Can we somehow use TA-lib with SQL server database as well ?

Best regards.
Thanks. I am a self-taught full time trader with my own website. I am decent at the python data analysis toolbox.

You can use TA-lib with SQL server data, though complicated.
I believe you have your data in SQL server. If this is the case and you have all the rights, its possible.
All you need is a just a loader (would do this in a few days) to load the necessary data
Yes, you got it right, I have the data inside a SQL server database and want to run a few queries on that. It is really great to know that we can use TA-lib with this.

Best regards
 

UberMachine

Well-Known Member
#14
Yes, you got it right, I have the data inside a SQL server database and want to run a few queries on that. It is really great to know that we can use TA-lib with this.

Best regards
If you know SQL, then try this

Python:
import pandas as pd
from sqlalchemy import create_engine
// Replace scott:tiger@hostname:port/dbname with your database credentials
engine = create_engine('mssql+pymssql://scott:tiger@hostname:port/dbname')

// Replace this with your own SQL query
sql_query = "SELECT * from tablename"
df = pd.read_sql(sql_query, engine)
I know this is too vague but just to keep you interested

Related links
Connecting to MSSQL Server in Python
Reading SQL queries in Python
 

cloudTrader

Well-Known Member
#16
Thanks for the response.
Looks even experienced traders are interested in learning Python.

Could I run some sort of a tutorial so that everybody could benefit out of this?
I need inputs from traders on this so that it could be better fit.
And I also intend to create a complete trading system instead of just dabbling with individual concepts
+1 from my side !! This will be exciting . Even though I am a non-techie but learning new things is always exciting

Keep It Up !!
 

VJAY

Well-Known Member
#17
+1 from my side !! This will be exciting . Even though I am a non-techie but learning new things is always exciting

Keep It Up !!
me too :) ...though am too like cloudtrader....non techie...also seems dumb too ...even not know even some simple techy words :D...but always interest in new things....I only hear about this python before ncube bro started that thread....now @least I started to use it in pairs :)
 

UberMachine

Well-Known Member
#18
me too :) ...though am too like cloudtrader....non techie...also seems dumb too ...even not know even some simple techy words :D...but always interest in new things....I only hear about this python before ncube bro started that thread....now @least I started to use it in pairs :)
I know the tech part is being highlighted a lot but we aren't going to do any High Frequency Trading or statistical arbitrage where speed and efficiency (tech) is the key.

We all have figured a system that works and just want to put it on steroids so that we can trade better. Its more on cutting down losses rather than increasing the profits.
In technical terms, increasing either the probability of our bets or increasing the value of our pay-off.

Not sure about others, but many a time I advise others on not to take a trade but I do take it.
Cutting down our rough edges and safeguard us from trades which we otherwise might not have taken; that's the important thing
 

UberMachine

Well-Known Member
#19
To begin with, I am going to introduce an extremely simple system.
If people are interested, we can start this system from Aug 16th.
  1. Place orders at the beginning of the day (short the top 5 returns the previous day)
  2. Keep a standard stop loss, say 3% and a standard SELL price percentage
  3. Close positions by the end of the day
Requirements
  1. Capital = 20000
  2. Leverage = 5
  3. Returns expected = 5 to 10% in 1 month
  4. Max drawdown = 5% * leverage
  5. Anaconda installed
  6. Zerodha broker
Why zerodha?
Because I use them and they have better automation tools to execute orders fast.

And everything is to be open source,; no paid data, no fancy indicators, no complex machine learning, nothing.
Just plain logic and a willingness to learn and some greatness to accept defeat and move on.

If this is OK, I may start posting further on this from next Wednesday
 

VJAY

Well-Known Member
#20
To begin with, I am going to introduce an extremely simple system.
If people are interested, we can start this system from Aug 16th.
  1. Place orders at the beginning of the day (short the top 5 returns the previous day)
  2. Keep a standard stop loss, say 3% and a standard SELL price percentage
  3. Close positions by the end of the day
Requirements
  1. Capital = 20000
  2. Leverage = 5
  3. Returns expected = 5 to 10% in 1 month
  4. Max drawdown = 5% * leverage
  5. Anaconda installed
  6. Zerodha broker
Why zerodha?
Because I use them and they have better automation tools to execute orders fast.

And everything is to be open source,; no paid data, no fancy indicators, no complex machine learning, nothing.
Just plain logic and a willingness to learn and some greatness to accept defeat and move on.

If this is OK, I may start posting further on this from next Wednesday
To begin with, I am going to introduce an extremely simple system.
If people are interested, we can start this system from Aug 16th.
  1. Place orders at the beginning of the day (short the top 5 returns the previous day)
  2. Keep a standard stop loss, say 3% and a standard SELL price percentage
  3. Close positions by the end of the day
Requirements
  1. Capital = 20000
  2. Leverage = 5
  3. Returns expected = 5 to 10% in 1 month
  4. Max drawdown = 5% * leverage
  5. Anaconda installed
  6. Zerodha broker
Why zerodha?
Because I use them and they have better automation tools to execute orders fast.

And everything is to be open source,; no paid data, no fancy indicators, no complex machine learning, nothing.
Just plain logic and a willingness to learn and some greatness to accept defeat and move on.

If this is OK, I may start posting further on this from next Wednesday
Great!!!UM....So its automated trades?...I not installed Anaconda will do it for learning....BTW whats this bolded part ...pls explain...is it only short trades?