I present my PostGres SQL statement to build your Position table for automated trading needs

(Last Updated On: October 16, 2014)

I present my PostGres SQL statement to build your Position table for automated trading needs

I have included for this which is used by PostGres. I also included a sample insert SQL statement as well.

Join my FREE newsletter to see how I implement this

CREATE TABLE test.positions
(idx int4,
shortsymbol varchar(15),
shortentrytimestamp numeric(25),
shortentrytimestr varchar(25),
shortentryprice money,
shortstoplossper numeric(25,5),
shortupstop money,
shortlowstop money,
shortsofttargperc numeric(25,5),
shortuptarget money,
shortlowtarget money,
longsymbol varchar(15),
longentrytimestamp numeric(25),
longentrytimestr varchar(25),
longentryprice money,
longstoplossper numeric(25,5),
longupstop money,
longlowstop money,
longsofttargperc numeric(25,5),
longuptarget money,
longlowtarget money,
shortexittimestamp numeric(25),
shortexittimestr varchar(25),
shortexitprice money,
longexittimestamp numeric(25),
longexittimestr varchar(25),
longexitprice money




INSERT INTO test.test.positions
    (idx, shortsymbol, shortentrytimestamp, shortentrytimestr, shortentryprice, shortstoplossper, shortupstop, shortlowstop, shortsofttargperc, shortuptarget, shortlowtarget, longsymbol, longentrytimestamp, longentrytimestr, longentryprice, longstoplossper, longupstop, longlowstop, longsofttargperc, longuptarget, longlowtarget, shortexittimestamp, shortexittimestr, shortexitprice, longexittimestamp, longexittimestr, longexitprice)
    (1, ‘F’, 73589, ’16-Oct-2014 15:38:25′, ‘1’, 0.1, ‘1.1’, ‘0.9’, 0.3, ‘1.3’, ‘0.7’, ‘GM’, 73589, ’16-Oct-2014 15:38:25′, ‘1’, 1, ‘1’, ‘1’, 1, ‘1’, ‘1’, 73589, ’16-Oct-2014 15:38:25′, ‘1.2’, 73589, ’16-Oct-2014 15:38:25′, ‘1.3’)

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Subscribe For Latest Updates

Sign up to best of business news, informed analysis and opinions on what matters to you.
Invalid email address
We promise not to spam you. You can unsubscribe at any time.


Check NEW site on stock forex and ETF analysis and automation

Scroll to Top