Hi,

I am writing some AFL that outputs a Risk:Reward ratio for each trade
to an HTML file.

I am using the AFL code at the bottom of this email.

The code outputs trades and ratios correctly from 2001-27/09/2005, 
but then trails off. This is strange, as I have trades entering and 
exiting up to 2007. You can see this HTML output here:

http://alexanderchambers.freewebspace.com/AdvancedTradeOutput.html

If anyone could try this code out and advise I'd be really grateful.

Alex

===========================================================

dtBuy = ValueWhen(Buy,DateTime());     // Date of buy
dtSell= ValueWhen(Sell,DateTime());    // Date of sell

rskL = IIf(Sell, (ValueWhen(Buy,LongStopBuy) - 
ValueWhen(Buy,LongStop)), 0); 
rwdaL = IIf(Sell,(SellPrice-ValueWhen(Buy,BuyPrice)),0);
rrwdL = 0;
rrwdL = rwdaL / rskL;     // This is the Risk:Reward ratio - works 
fine   

a = "<html><body><table border='1'><tr><td>Direction</td><td>In</
td><td>Out</td><td>Risk:Reward</td></tr>";

for (i=1; i<BarCount; i++)
{
if (Sell[i])
        {       
                a = a + "<tr><td>BUY</td><td>"+DateTimeToStr(dtBuy[i])+"</
td><td>"+DateTimeToStr(dtSell[i])+"</td><td>"+rrwdL[i]+"</td></tr>";

        }
}


Reply via email to