"It is not the responsibility of the language to force good looking code, but the language should make good looking code possible." -- Yukihiro MatsumotoI just discovered the power of Ruby!!!
More later,
MT
The critical ingredient is a maverick mind. Focus on trading vehicles, strategies and time horizons that suit your personality. In a nutshell, it all comes down to: Do your own thing (independence); and do the right thing (discipline). -- Gil Blake
"It is not the responsibility of the language to force good looking code, but the language should make good looking code possible." -- Yukihiro MatsumotoI just discovered the power of Ruby!!!
"And don't write longer, more obtuse code because you think it's faster. Remember, hardware gets faster. MUCH faster, every year. But code has to be maintained by programmers, and there's a shortage of good programmers out there. So, if I write a program that's incredibly maintainable and extensible and it's a bit too slow, next year I'm going have a huge hit on my hands. And the year after that, and the year after that.Great quote! Read more on this topic here.
If you write code with more code that's fast now, you're going to have a hit on your hands. And next year, you're going to have a giant mess to maintain, and it's going to slow you down adding features and fixing bugs, and someone's going to come along and eat your lunch." -- Wil Shipley
"Be careful about using the following code -- I've only proven that it works, I haven't tested it." -- Donald KnuthI have finally started my dynamic allocation of equity project. This is something I've stewed about for several weeks...okay...maybe months. But, after meeting with Jon for lunch this weekend...I finally got the motivation back to begin work on the project. Thanks Jon!
******Begin of Code***********************
from pysqlite2 import dbapi2 as sqlite
conn = sqlite.connect("TaylorTree")
cursor = conn.cursor()
SQL = """
create table MarketDaily
(
Symbol text,
Bar SQL_DATE,
Open float,
High float,
Low float,
Close float,
Volume float,
AdjClose float,
primary key (Symbol, Bar)
);
"""
cursor.execute(SQL)
******End of Code***********************
******Begin of Code***********************Fetch from Table:
from pysqlite2 import dbapi2 as sqlite
conn = sqlite.connect("TaylorTree")
cursor = conn.cursor()
SQL = """
insert into MarketDaily
(Symbol, Bar, Open, High, Low, Close, Volume, AdjClose)
values
(
"YHOO",
20060801,
20.00,
25.00,
19.00,
22.00,
50000,
22.00
);
"""
cursor.execute(SQL)
conn.commit()
******End of Code***********************
******Begin of Code***********************
from pysqlite2 import dbapi2 as sqlite
conn = sqlite.connect("TaylorTree")
cursor = conn.cursor()
SQL = "select * from MarketDaily"
cursor.execute(SQL)
# Retrieve all rows as a sequence and print that sequence:
print cursor.fetchall()
cursor.close()
******End of Code***********************
******Begin of Code***********************
from pysqlite2 import dbapi2 as sqlite
conn = sqlite.connect("TaylorTree")
cursor = conn.cursor()
SQL = "drop table MarketDaily"
cursor.execute(SQL)
******End of Code***********************
******Begin of Code***********************After spending a lot of time getting all that going...I then turn back to pytables. Maybe I need to dig deeper there. Found some very good documentation here. But, I'm still sitting here...nothing. Hey, someone give me some motivation on working with this bad boy! Anybody have any experience to share in regard to pytables? If so, bring it on! I need some mojo!
from pysqlite2 import dbapi2 as sqlite
conn = sqlite.connect("TaylorTree")
cursor = conn.cursor()
def UpdatePrice(sym, b, o, h, l, c, v, ac):
SQL = """
insert into MarketDaily
(Symbol, Bar, Open, High, Low, Close, Volume, AdjClose)
values
(
'%s',
%s,
%s,
%s,
%s,
%s,
%s,
%s
);
""" % (sym, b, o, h, l, c, v, ac)
cursor.execute(SQL)
conn.commit()
******End of Code***********************
******Begin of Code********2 lines. Now, I'm sure there is a much easier way to call a COM Object in C# that what I was trying to do. If anyone out there knows how...please leave a comment. I'm really interested to see how many lines it takes to connect.
import win32com.client
w=win32com.client.Dispatch("TC2000Dev.cTC2005")
******End of Code**********
"One of the best attributes I know a trader to have is humility. The best traders I know admit to knowing very little about what the market will do or don't pretend to have any kind of secret method or style or edge that others don't have. They just go in to work everyday like a brick layer. Their goal is to lay bricks. One at a time. And hopefully at the end of their life they have built a solid foundation. That's all a trader can hope for." -- Maverick74Found the great quote above perusing EliteTrader this weekend. The thread is titled, Writing Options for a Living, read here. You'll have to be patient because a lot of time is spent with posts from people still believing in the Easter Bunny. But, there are a few gems to be found...especially from Maverick74, riskarb, and a few others.
" Becoming wealthy is like playing Monopoly.. the person who can accumulate the most assets wins the game."
-- Noel Whittaker