I already have a good working VBS Script, but i want to make some small changes. I need to replace some text and i want to add a hyperlink on every row.
## Deliverables
This is the VBS script. This script creates a HTML which is shown below this script.
I need to make only 2 small changes, I want to rename the symbols ( you can find them in the HTML output file in bold+orange) so AEX becomes AEX25 for example.
and i want to add a hyperlink on the end of every row. so in the end of AEX , after the % row, i want to create a hyperlink. You can fill in any example there, i will changes it to the correct location.
LoadLocation = "C:\Documents and Settings\All Users\Documenten\Amibroker\[login to view URL]"
SaveLocation = "C:\Documents and Settings\Gerard\Bureaublad\"
'DEFINE REPORT NUMBERS: Example: GetReports = "1,2,10"
GetReports = "0"
UseFont = "Tahoma,Arial,Helvetica,Sans Serif"
UseFontSize = "10px"
Set oAB = CreateObject("[login to view URL]")
Set oAA = [login to view URL]
'test '("c:\\Program Files\\Amibroker\\MyNewData4")
[login to view URL]("C:\\Program Files\\Amibroker2\\Metastock")
arrReports = SPLIT(GetReports,",")
for intReport = LBOUND(arrReports) to UBOUND(arrReports)
[login to view URL]()
[login to view URL](0, "watchlist" ) = arrReports(intReport)
[login to view URL] (LoadLocation)
[login to view URL] = "1"
[login to view URL]()
[login to view URL] (SaveLocation & "Futurescomplete" & intReport & ".html")
next
Set oAA = Nothing
Set oAB = Nothing
'LETS CLEAN THE FILES
for intReport = LBOUND(arrReports) to UBOUND(arrReports)
Call CleanReports(SaveLocation & "Futurescomplete" & intReport & ".html")
next
function CleanReports(reportname)
NewContent = ""
Set objFSO = CreateObject("[login to view URL]")
if [login to view URL](reportname) then
Set objTextFile = [login to view URL](reportname, 1, True)
StrContent = [login to view URL]
arrText = SPLIT(StrContent, vbcrlf)
For az = LBOUND(arrText) to UBOUND(arrText)
if Left(arrText(az),2)="TD" then
NewContent = NewContent & "TD { text-align: right; font-family: " & UseFont & ";font-size: " & UseFontSize & "; }" & vbcrlf
NewContent = NewContent & "TH { text-align: right; font-family: " & UseFont & ";font-size: " & UseFontSize & "; }" & vbcrlf
elseif Left(arrText(az),4)="BODY" then
NewContent = NewContent & "BODY { text-align: right; font-family: " & UseFont & ";font-size: " & UseFontSize & "; }" & vbcrlf
elseif Left(Ucase(arrText(az)),17)="<TR><TD>~~~EQUITY" then
else
NewContent = NewContent & Replace(arrText(az),"^","")& vbcrlf
end if
Next
[login to view URL]
Set objTextFile = Nothing
Set objFile = [login to view URL](reportname, true)
[login to view URL] NewContent
[login to view URL]
Set objFile = Nothing
end if
Set objFSO = Nothing
end function
This is the output HTML file:
<HTML>
<STYLE>
<!--
BODY { text-align: right; font-family: Tahoma,Arial,Helvetica,Sans Serif;font-size: 10px; }
TD { text-align: right; font-family: Tahoma,Arial,Helvetica,Sans Serif;font-size: 10px; }
TH { text-align: right; font-family: Tahoma,Arial,Helvetica,Sans Serif;font-size: 10px; }
-->
</STYLE>
<!-- ABEXC: Type=3, ReportPath= --><BODY>
<TABLE border=0>
<TR><TH id=0>Ticker</TH><TH id=2>Date/Time</TH><TH id=1>Close</TH><TH id=0> Position </TH><TH id=0>Last Signal</TH><TH id=1>Entry Price</TH><TH id=1>Stop/Reverse</TH><TH id=1>Profit Target</TH><TH id=1>P/L 2008 (%)</TH></TR>
<TR><TD>**AEX**</TD><TD>5/22/2009</TD><TD bgcolor='#ffffff'><FONT color='#000000'>260.14</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>Neutral</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>Target Hit!</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>0.00</FONT></TD><TD bgcolor='#ffff00'><FONT color='#000000'>247.34</FONT></TD><TD bgcolor='#7d9ec0'><FONT color='#000000'>0.00</FONT></TD><TD bgcolor='#ffffff'><FONT color='#009300'>236.31</FONT></TD></TR>
<TR><TD>**BFX**</TD><TD>5/22/2009</TD><TD bgcolor='#ffffff'><FONT color='#000000'>2,064.60</FONT></TD><TD bgcolor='#ff0000'><FONT color='#000000'>Short</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>14/05/09</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>2,020.80</FONT></TD><TD bgcolor='#ffff00'><FONT color='#000000'>2,126.06</FONT></TD><TD bgcolor='#7d9ec0'><FONT color='#000000'>1,859.14</FONT></TD><TD bgcolor='#ffffff'><FONT color='#009300'>177.53</FONT></TD></TR>
<TR><TD>**FCHI**</TD><TD>5/22/2009</TD><TD bgcolor='#ffffff'><FONT color='#000000'>3,228.00</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>Neutral</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>Target Hit!</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>0.00</FONT></TD><TD bgcolor='#ffff00'><FONT color='#000000'>3,100.31</FONT></TD><TD bgcolor='#7d9ec0'><FONT color='#000000'>0.00</FONT></TD><TD bgcolor='#ffffff'><FONT color='#009300'>392.28</FONT></TD></TR>
<TR><TD>**GDAXI**</TD><TD>5/22/2009</TD><TD bgcolor='#ffffff'><FONT color='#000000'>4,918.80</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>Neutral</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>Target Hit!</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>0.00</FONT></TD><TD bgcolor='#ffff00'><FONT color='#000000'>4,676.19</FONT></TD><TD bgcolor='#7d9ec0'><FONT color='#000000'>0.00</FONT></TD><TD bgcolor='#ffffff'><FONT color='#009300'>363.69</FONT></TD></TR>
<TR><TD>**GSPC**</TD><TD>5/22/2009</TD><TD bgcolor='#ffffff'><FONT color='#000000'>887.00</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>Neutral</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>Target Hit!</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>0.00</FONT></TD><TD bgcolor='#ffff00'><FONT color='#000000'>863.85</FONT></TD><TD bgcolor='#7d9ec0'><FONT color='#000000'>0.00</FONT></TD><TD bgcolor='#ffffff'><FONT color='#009300'>412.20</FONT></TD></TR>
<TR><TD>**N225**</TD><TD>5/22/2009</TD><TD bgcolor='#ffffff'><FONT color='#000000'>9,225.80</FONT></TD><TD bgcolor='#00ff00'><FONT color='#000000'>Long</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>06/04/09</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>8,856.80</FONT></TD><TD bgcolor='#ffff00'><FONT color='#000000'>8,845.05</FONT></TD><TD bgcolor='#7d9ec0'><FONT color='#000000'>9,565.34</FONT></TD><TD bgcolor='#ffffff'><FONT color='#009300'>396.05</FONT></TD></TR>
<TR><TD>**NDX**</TD><TD>5/22/2009</TD><TD bgcolor='#ffffff'><FONT color='#000000'>1,363.20</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>Neutral</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>Target Hit!</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>0.00</FONT></TD><TD bgcolor='#ffff00'><FONT color='#000000'>1,332.56</FONT></TD><TD bgcolor='#7d9ec0'><FONT color='#000000'>0.00</FONT></TD><TD bgcolor='#ffffff'><FONT color='#009300'>347.78</FONT></TD></TR>
<TR><TD>**RUT**</TD><TD>5/22/2009</TD><TD bgcolor='#ffffff'><FONT color='#000000'>477.62</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>Neutral</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>Target Hit!</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>0.00</FONT></TD><TD bgcolor='#ffff00'><FONT color='#000000'>462.89</FONT></TD><TD bgcolor='#7d9ec0'><FONT color='#000000'>0.00</FONT></TD><TD bgcolor='#ffffff'><FONT color='#009300'>461.05</FONT></TD></TR>
<TR><TD>**STOXX50E**</TD><TD>5/22/2009</TD><TD bgcolor='#ffffff'><FONT color='#000000'>2,433.50</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>Neutral</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>Target Hit!</FONT></TD><TD bgcolor='#ffffff'><FONT color='#000000'>0.00</FONT></TD><TD bgcolor='#ffff00'><FONT color='#000000'>2,280.24</FONT></TD><TD bgcolor='#7d9ec0'><FONT color='#000000'>0.00</FONT></TD><TD bgcolor='#ffffff'><FONT color='#009300'>308.10</FONT></TD></TR>
</TABLE>
</BODY>
</HTML>