Skip to content

Instantly share code, notes, and snippets.

@chuckremes
Created July 14, 2009 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuckremes/147134 to your computer and use it in GitHub Desktop.
Save chuckremes/147134 to your computer and use it in GitHub Desktop.
def write_file filename
File.open(filename, "w") do |file|
file.puts "#\tSUMMARY"
file.puts "#\tWINNER%\tPRODUCT\tDURATION\tPROFIT GOAL\tTIME\tAVG PROFIT\tAVG RISK\tBREAKOUT%\tRISK RATIO\tAVG ENTRY\tAVG EXIT\tAVG MAX EXIT\tAVG DRAWDOWN"
winner_summary.each do |line|
file.puts("#\t" + line.join("\t"))
end
file.puts "#\tLOSER%\tPRODUCT\tDURATION\tPROFIT GOAL\tTIME\tAVG PROFIT\tAVG RISK\tBREAKDOWN%\tRISK RATIO\tAVG ENTRY\tAVG EXIT\tAVG MAX EXIT\tAVG DRAWDOWN"
loser_summary.each do |line|
file.puts("#\t" + line.join("\t"))
end
file.puts
file.puts
file.puts "#DATE\tTIME\tPRODUCT\tDURATION\tSTOP TICKS\tSLIPPAGE\tHIGH\tLOW\tRISK\tSIDE\tPROFIT GOAL\tPROFIT GOAL LOCK%\tENTRY TIME\tPROFIT\tSCALP TIME\tMAX PROFIT\tSCALP TIME\tMA
X DRAWDOWN"
sorted.each do |line|
file.puts(line.join("\t"))
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment