March 2000

Article:
In Search of A Holy Grail
by Howard Arrington

What a difference a month makes.   I hope you have had as much fun with these markets as I have had.   I trade stocks and grew my account nicely in January.   I equaled that success in February until I got on the wrong side of the market on a couple of those big down days in the DOW.   I shouldn't complain because February was still a positive month for me, but only half of January's success.   Being beat up by the market for a few days in February reawakened in me a yearning for a successful mechanical trading system that would remove the emotional and mental debate about what to do next.

My brother and I spent hundreds of hours in the past few weeks researching an idea we have. To our great delight, the theoretical results are considerably better than we hoped for.   Now, I am not going to promote our system by telling you everything we are doing.   That is not my purpose.   My newsletter objective is to teach you how to think for yourself.   This article will touch on the process we recently went through in our search for a Holy Grail trading system that fits our objectives and trading style.

Step 1:  It all started with a unique idea that would generate a buy signal in a daily stock chart.   Since I live near the Grand Teton mountain, I will name this idea the Teton signal.   To research whether the Teton signal had any merit, I arbitrarily chose the first week of January, and generated a focus group of 21 stocks that had the Teton signal that week.   My simulation bought 1,000 shares of each stock and held the stocks until February 23rd, showing a profit of $54,000.   Since the Nasdaq has put in record highs since January, I need to be very cautious because the Teton signal may not work in a down market.

Step 2:  I then examined the stocks picked by the Teton signal and observed that about half the stocks were priced under $10. So, I divided the portfolio into two groups:  Over $10 and Under $10.   The average profit for the Under $10 group was 50% greater than the average profit for the Over $10 group.   Therefore, the first improvement to my Holy Grail was a decision to invest only in the Under $10 stocks.   The profit jumped to $78,000 for the Under $10 focus group by using the same capital as Step 1.

Step 3:  The next consideration was to compare buying a fixed number of shares versus buying an equal dollar amount of each stock.   Balancing dollar distribution among the stocks in the focus group increased the profit to $110,000.   The capital requirement remained the same, but buying $10,000 of each stock was more profitable than buying the same number of shares for each stock.   I did not know this would be the result until I tried the idea on my focus group.

Step 4:  The improvements in Step 2 and 3 evolved the system to twice the profit of the initial idea.   But the focus group was too small to be statistically significant.   So, the Teton signal was used to find a 2nd focus group of 24 stocks from the 2nd week of January.   Profits from the 2nd focus group were not quite as high as the 1st study group, but my enthusiasm still rose because the Teton signal seemed to be repeatable with the 2nd group.   Using both groups, I concentrated on finding a common characteristic among the losers and put in an adjustment to the Teton signal to eliminate the losers.   Naturally, any adjustment to the signal will eliminate or add both losers and winners, but a change is worth keeping if more losers are eliminated than winners, and relative profits increase.   Since the Teton signal was tweaked, I reran the signal on both week #1 and week #2 to reestablish the focus groups for these two weeks.   Results were verified and found to be better.

Step 5:  By now, we felt we were on to something worthwhile, and it was time to work with a large focus group and do some serious back testing.   The Teton signal was used to create 17 groups for the 17 weeks in November 1999 through February 2000.   Each week was treated as a separate focus group and kept in a separate Ensign Windows trading account.   The smallest group had 7 signals in one week, and the largest group had 32 signals.   For each signal, $10,000 worth of stock was bought (paper trade) using the closing price of the day that had a Teton signal.   Collectively, the 17 focus groups contained 300 stocks.   Profits were encouraging because the 15 oldest groups showed profits.  The two groups for the last two weeks of February showed losses, but this is probably due to the shortness of time.   The stocks picked by the Teton signal need time to mature before they can be evaluated as a good or bad investment.

Step 6:  Coming up with an idea and generating lots of signals over the past 4 months was the easy part.   The next several steps address money management issues because we don't happen to have several million dollars of capital to buy $10,000 worth of stock every time we get a Teton signal.   However, an audience of 300 stocks makes for a wonderfully diverse set of stocks to analyze.   The up trending markets of November and December are countered by the down trending markets seen in January and February, and our Teton signal appears to work well in both types of markets.   In this step, we studied the benefit of using a protective stop at various percentage levels of retracement.   Our tests showed that the system would be most profitable if we did not use any protective stop.   Probably this unexpected result is due to having a diversity of 300 stocks and the Nasdaq has moved to new record highs.

To determine these results, a sophisticated ESPL script was written that would open charts for each stock in our 17 trading accounts, find the signal date, make a $10,000 trade and either keep the position until Feb 23rd, or exit at the stop loss level being tested.   This was not a trivial step to take in our research.   The power of the ESPL programming language in Ensign Window really shined, and we were able to generate beautiful reports with great statistics to support our research.  The script we wrote for our research is shared with you in this newsletter.

Step 7:  The next idea examined was an exit strategy.   Is there a percentage gain target that is optimal?   For example, a high percentage of the stocks picked by the Teton signal gained 50%, a goodly percentage gained 100%, and a few gained several hundred percent.   The ESPL script created for Step 6 was enhanced to search out the answer.   Part of the complication of finding an answer involves the recycling of one's capital.   Is it better to get a $20,000 profit in three months or exit after a $10,000 gain in one month, and buy two new $10,000 positions?   That is a tough question to answer.   For our 17 focus groups, we think the optimum profit target is a 100% gain.   Although a 200% profit target showed a greater profit on February 23rd, it represented a lower growth rate per day than using a 100% target.   Those stocks which achieved their 100% targets did so in an average of 7 to 8 weeks.   Recycling those profits into stocks with new Teton signals made more money than holding the original stocks for a higher target objective.

Step 8:  The next exit strategy that was examined involved time.   For this test, all stocks were allowed to run without exiting at a target objective.   A position would be sold after a fixed number of days from the Teton signal date.   The ESPL script gave profit results in weekly increments from 1 week to 20 weeks.   We think that holding a position for 8 weeks has the optimal growth rate.   Holding rising stocks for 20 weeks shows a greater profit, but not a greater rate of growth.   The average growth rate for 8 weeks might be $175 per day for a $10,000 position, and a lower $125 per day if held 20 weeks.

Step 9:  All profit comparisons were made relative for the amount of capital required to finance a strategy.   New positions were acquired each day, rather than all at once.   The profit from the November trades becomes available to finance some trades in January or February.   This is how a real account would work.   300 positions were not acquired all at the same time, nor liquidated at the same time.   There is a staggering of each which affects the net position held in any given week.   Our ESPL reports showed the weekly total position held.   Subtracting the profit achieved week by week gave us the position size that was being financed by our capital.   Making all profit figures relative to each other answers a question like:  Is strategy A which made $100,000 by using capital for 100 positions more or less favorable than strategy B which made $60,000 with 50 positions?   By normalizing the results, relative worth shows strategy B to have a better average value per position.

Step 10:  Several of the preceding steps examined strategies for exiting the positions initiated by the Teton signal.   However, one flaw was our assumption that the position was bought using the close of the signal day.   A better reality would be to buy the next day's open.   An even more realistic approach would be to buy the open price, with a built in penalty for a typical spread between a bid/ask price.   Assume the open is a bid, but we must buy at a higher ask price.   Making these changes to our ESPL calculations naturally degraded the profits, but the system still generated enviable results for our focus group of 300 stocks.

Part of the analysis was to test various entry strategies, such as a limit on how large of an opening gap to tolerate, or should we hold out for an entry opportunity at yesterday's closing signal price.   Our tests showed that relative profits would be better if we hold out for a entry price 10% below the close on the signal day.   For example, if the close on the signal day was $5, we would only buy the stock at $4.50 or lower.   True, many of our original 300 stocks could not be purchased because of this 10% lower requirement, but the additional profits made on those trades that did get purchased made up for the missed trades.   Again, all profits have to be made relative as was done in step 9.   Perhaps we missed 150 of the 300 trades because the 150 never retreated 10% plus slippage so we could buy a position.   Yet, the relative profit from the 150 exceeded the profit from the 300.

Step 11:  We revisited one of the steps done earlier by examining many of the losers.   One characteristic we noticed was many of them were thinly traded stocks.   Therefore, we did an analysis on average volume and added a minimum average volume requirement to our Teton signal.  The threshold we chose reduced the 300 signals by 16, 1 of which was a great winner and 15 of which were either losers or under performers.   Again, this tweak improved the relative profit of our Holy Grail by eliminating dead weight which pulled down the average daily growth rates.

Step 12:  Our final step was just more icing on the cake.   We are constantly improving our system, and have answered for ourselves various questions about how to get in and how to get out of our positions.   Our system generates more signals than we can possibly take, yet we hesitate to arbitrarily take some and skip others just because we are under capitalized.   We needed to know which of the 300 signals are likely to be super stars.   In general, all signals were great because of recent advances in the Nasdaq.   But some are exceptional and we wanted to discover the difference.   This is a perfect application for a neural net to solve.   We chose as inputs to a neural net various chart characteristics on the day of the Teton signal such as net, range, Stochastic, price, volume and average volume.   We also used various fundamentals such as P/E ratio and dividend.   Signals from December and January were used to train the network, and then the November signals were run through the network to compare the network forecast with the reality of November's trades.   The forecast looked excellent.   Therefore, we retrained the network using November, December and January signals, and used it to evaluate February's signals.   Of course we use the neural net to appraise the potential of every new Teton signal we might get.

Basically the neural net separates the signals into two groups:  Above average performers, and Below average performers.   We used the neural net to divide February's 80 signals into these two groups.   We found the stocks forecast to be Above average in reality have an average gain of $5500, while the stocks forecast to be Below average have an average gain of $850.   That is a fantastic A|B separation which suggests that the neural net is performing well.   The neural net is discovering something in the cross relationship of the various inputs that is too complex for my mind to discover.   I have no idea what it is that the neural net is seeing and using in its decision process to forecast a signal for either group.   As long as it is working so well, I am content not to know.   I'll just use it to my advantage, and use my limited capital to buy stocks forecast to be in the Above average group.

Summary:  The Teton signal picks a great set of stocks to buy.   But it is our research in strategies for how to enter and how to exit that greatly enhances the profits.   Every step that was taken to statistically separate the cream from the milk made the system more profitable and doable considering the limited capital we have in our accounts.

Now I'll answer the question you all want to ask.   Does Howard believe in the results of his research enough to put money on it?   The answer is a definite YES.   My brother and I did not do all this work to have fodder for an article in my newsletter.   In fact, my brother's preference is to keep quiet about what we do.   We did it for our private use, and we both have made trades in our accounts based precisely on the mechanical system we have researched.   It is too early to tell whether our accounts will be as profitable in reality as was seen in hindsight, but we do believe in the value of our ideas and that the results are statistically substantiated by our research.   Although the DOW had a significant down move in January and February, the Nasdaq did not.   How the system would perform in a bear market is yet to be determined.

Everything I have shared with you is for one purpose only, and that is to show you the process of evolution or improvement.   I do not propose that you accept any detail I have given as having application to your trading.  Our results apply only to those unique stocks picked by our private Teton signal.   It is a signal designed for me and my brother and fits the type of trading we want to do in the stock market.   Every one is different and what works for us would not necessarily work for you.   But, as you seek to develop a trading system that works for you, perhaps you will consider using some of the steps I used in my personal search for a Holy Grail.   Good luck to all of us.


Trader Profile:
David Kaiser

David Kaiser has been trading Commodities for nearly 30 years. His longevity as a successful trader is his most impressive credential. David has been an Ensign Software customer since the mid 1980's.

ES: Give a brief summary of your trading history and background?

DK: I started trading penny stocks at age 15. My mom opened the account in her name since I was too young. I traded money that I earned mowing lawns. I have been trading commodities since 1972. I traded mostly spreads at first. I used to draw charts by hand everyday. It was a lot of work to manually update the charts. For the past 15 years I have used Ensign Software programs to facilitate my trading. After some success in the markets, a few friends asked if I would trade some money for them. Since then I have been trading for myself and a few others full time. I trade commodities exclusively. I have a trading room at home in my basement. The daily commute is great.

ES: What kind of Computer equipment and Software do have in your trading room?

DK: I use basic Pentium IBM clone computers. Nothing special. I was even using a 386 computer until a few months ago. As far as software goes, I have had every Ensign Software product since Ensign 1.  I currently use both Ensign 6 (DOS) and Ensign Windows.  I really like Ensign Software because they are so responsive.  If I ever have a program request or a problem, the response or fix is almost immediate.  You can't find that anywhere else.

ES: Which markets do you trade?

DK: I only trade the commodities markets. I trade whatever is moving. I will trade any commodity if it looks good. My favorite market right now is the E-Mini S&P market. I like it because it trades electronically and is very easy to get in and out.

ES: What chart time-frames do you use?

DK: I mostly use Daily charts and 30-minute charts. These time frames give me what I need, without having to look at other chart times.

ES: Which technical analysis studies and tools do you use?

DK: I like to use the Keltner Channel and the Relative Strength Index. I also use Ensign's Custom Symbols feature to build my own Indexes. These custom Indexes help me keep track of different market groups.

ES: What kind of chart formations do you look for?

DK: I mostly look for consolidations, where the market is moving sideways. I like to buy the bottoms and sell the tops of consolidations, in conjunction with Elliott wave counts.

ES: How frequently do you trade?

DK: Several times a day in multiple markets.

ES: What kind of money management or risk management do you use?

DK: No specific rules. I will exit a trade if it doesn't act like I thought it should, rather than wait around for the market to stop me out. I won't let a losing trade grow bigger than the expected profit from the trade. Sometimes I place a stop on a trade, depending on the market conditions… (like if Alan Greenspan is at the microphone speaking). Other times I just jump out of a trade when it doesn't go as I expected. The trade could be at a profit or a loss.

ES: What was one of your best trades?

DK: Actually, my best trade was a mistake. A few years back I placed an order to short the Cotton market. The broker never called me back and I thought that the trade was not filled. I wasn't very diligent at checking my daily open positions. I didn't realize that I was short Cotton for over a week. By the time I found out that I had a Cotton position, the trade had a $20,000 profit. I'm not proud of the trade because it could have been a huge loss. I got lucky that time. I keep better track of my positions now.

ES: What was one of your worst mistakes?

DK: Adding to a losing position. I have made that mistake maybe a dozen times over the years. I won't make it again. I won't ever try to average a losing position. It's just trouble. It's much better to just step aside and then re-enter your next trade with a clear head.

ES: What do you look for in a broker?

DK: The two big items I look for are 1) low commissions, and 2) electronic trading access. I currently use electronic trading software that has ties with Ensign Software. It works great. I get fills in 3 seconds for some markets. I make sure to verify my trades and equity everyday. A good broker should correct any problems immediately.

ES: What advice would you give to a new trader?

DK: Focus on managing your losing trades. The profitable trades will take care of themselves. If you want to stay in business, don't add to a losing trade, and don't hang on to losing trades. I know people that have gone broke because they fell in love with a losing trade and wouldn't step aside. You can always put a new trade back on. One big loss will kill a new account.

ES: What is the ideal trade for you?

DK: A trade that moves in my direction right away. This validates my reasons for placing the trade. It's a lot nicer deciding where to take profits, than trying to figure out how to exit a bad trade.


ESPL Tutor:
Analyze Trade Objectives

This script is too extensive to document or explain in detail.  It is provided for those who want to test their Holy Grail idea in the same manner that I and my brother tested our ideas.   This is the script we wrote to support our research effort.   If you will spend some time studying the script, you can probably learn a neat trick or two.

-- Program to analyze Trade Accounts
-- with various Targets, Stops and Time exits
-- John Arrington and Howard Arrington

var   
 ex,sa,ta,vi,i,j,k,m,n,tp,sl,nAccounts,signalDate: integer;
 wDays,wCount,twDays,twCount: integer;  {Winner series}
 sDays,sCount,tsDays,tsCount: integer;  {Stop loss series}
 oDays,oCount,toDays,toCount: integer;  {Open position series}
 fDays,fCount,tfDays,tfCount,nCount,tnCount: integer;   {Forced Time exit}
 wRate,sRate,oRate,fRate,fValue,oValue,toValue,tfValue: real;
 twRate,tsRate,toRate,tfRate,tRate: real;
 b,bShow,bPosition: boolean;
 s,symbol,exitDate,entryDate,signalClose,tPrice: string;
 signalprice,maxprice,openPrice,entryPrice,stopLossPrice,targetPrice: real;
 dl,slip,p,v,x,y,z,xr,av,ar,pObject,sObject,mp: real;

procedure Write4(n: real);
begin
 if n=0 then write('    ') else Write(Format('%4.0f',n));
end;

BEGIN
 tp := 0;    {set Target Price Objective as a percent increase, 0 = none}
 sl := 0;    {set Stop Loss protection as a percent loss, 50 = exit down 50%}
 sa := 22;   {start with account #}
 ta := 23;   {end with account #}
 ex := 0;    {force exit after this many trade days, typically 5 days per week}
 mp := -10;  {entry price can be a maximum percent above signal price}
 slip:=5;    {ask price slippage as a percent, 10% = 50 cents on a $5 stock}
 dl := 5000; {dollar amount invested per trade}

 Output(eClear); DimArray(2500); for i:=0 to 2500 do SetArray(i,0);
 pObject:=dl*tp/100; sObject:=dl*sl/100; bShow:=((sa+10)>ta);
 Writeln(Format('TARGET gain =%3.0f',tp),'%',Format('  $%5.0f',pObject));
 Writeln(Format('STOP   loss =%3.0f',-sl),'%',Format('  $%5.0f',sObject));
 Writeln(Format('LIMIT entry =%3.0f',mp),'%');
 Writeln(Format('SLIPPAGE    =%3.0f',slip),'%');
 Writeln(Format('TIME   out  =%3.0f trading days',ex)); if ex=0 then ex:=10000;

 twCount:=0; tsCount:=0; toCount:=0; tfCount:=0; tnCount:=0;
 twDays:=0; tsDays:=0; toDays:=0; tfDays:=0;
 twRate:=0; tsRate:=0; toRate:=0; tfRate:=0;
 tfValue:=0; toValue:=0;

 for m := sa to ta do begin Writeln(); inc(nAccounts);    {--loop accounts--}
  sList.LoadFromFile(sPath+'Accounts\Account.'+IntToStr(m));
  Writeln(Copy(sList.strings[1],3,30),'  Account #',m);
  if bShow then Writeln(
   'Symbol Signal  %Up Close  Open Entry Target  Last  Days  Value  Rate Watch');

  wCount:=0; sCount:=0; oCount:=0; fCount:=0; nCount:=0;
  wDays:=0; sDays:=0; oDays:=0; fDays:=0;
  wRate:=0; sRate:=0; oRate:=0; fRate:=0;
  oValue:=0; fValue:=0;

  for i:=3 to pred(sList.Count) do begin
   s:=sList.strings[i];
   exitDate:=Trim(GetToken(8,s,#44));
   symbol:=Trim(GetToken(3,s,#44));
   if length(symbol)>0 then begin
    if bShow then ChartReplace(symbol) else ChartLoad(symbol);
    entryDate:=Trim(GetToken(6,s,#44));
    k:=StringToDate(entryDate)-19000000;
    signalDate:=Bar(eIndex,k); b:=False; bPosition:=false;
      
    if signalDate<BarEnd then openPrice:=Open(signalDate+1)/100
    else openPrice:=Last(signalDate)/100;
    signalprice:=Last(signalDate)/100;
    entryprice:=signalprice*(1+slip/100);
    maxPrice:=signalPrice*(1+mp/100);
    if entryPrice>maxPrice then EntryPrice:=MaxPrice;
      
    stopLossPrice:=entryPrice*sl/100;           {-- STOP at % of EntryPrice--}
    if tp=0 then targetPrice:=9999999
    else targetPrice:=entryPrice*((tp/100)+1);  {-- TARGET at % of EntryPrice--}
    if tp=0 then tPrice:='       ' else tPrice:=Align(targetPrice,7);
      
    p:=(Last(signalDate)-Last(signalDate-1))/Last(signalDate-1)*100;
    if bShow then Write(Align(symbol,5),Align(entryDate,9),Format('%4.0f',p),
     Align(Last(signalDate)/100,6),Align(OpenPrice,6));

{   if bShow then begin}
{    Remove(eArrow);}
{    AddLine(eArrow,112,signalDate+1,entryPrice*100);}
{    AddLine(eArrow,116,signalDate+1,targetPrice*100);}
{    AddLine(eArrow,116,signalDate+1,stopLossPrice*100);}
{   end;}

    for j:=signalDate+1 to BarEnd do begin     {--find entry and exit --}
     if not bPosition then begin
      if (Open(j)*(1+slip/100)/100)<=maxPrice then begin
       entryPrice:=Open(j)*(1+slip/100)/100; bPosition:=true; b:=true;
      end
      else if (Low(j)*(1+slip/100)/100)<=maxPrice then begin
       entryPrice:=maxPrice; bPosition:=true; b:=true;
      end;
     end;

     if b then begin
      vi:=1000-BarEnd+j; SetArray(vi,vArray(vi)+1);
      v:=(Last(j)/100-entryPrice)/entryPrice*dl;
      SetArray(vi+500,vArray(vi+500)+v);
     end;
    
     if b and (Low(j)<=stopLossPrice*100) then begin  {-- test for STOP out --}
      n:=j-signalDate-1; if n<1 then n:=1; b:=False;
      inc(sCount); sDays:=sDays+n; z:=n; if z<5 then z:=5;
      sRate:=sRate+sObject/z;
      for z:=vi+501 to 1500 do SetArray(z,vArray(z)-sObject);
      if bShow then writeln(Align(entryPrice,6),tPrice,' ',
       Copy(DateToString(Bar(eDate,j)),1,5),
       Format('  %3.0f  <STOP>%6.0f',n,-sObject/n));
     end;
  
     if High(j)>20000 then writeln('>>>> '+symbol+' <<<<  Possible Bad Data')
     else
     if b and (High(j)>targetPrice*100) then begin   {-- price TARGET reached --}
      n:=j-signalDate-1; if n<1 then n:=1; b:=False;
      inc(wCount); wDays:=wDays+n; z:=n; if z<5 then z:=5;
      wRate:=wRate+pObject/z;
      y:=trunc(n/5); SetArray(y,vArray(y)+1); 
      for z:=vi+501 to 1500 do SetArray(z,vArray(z)+pObject);
      if bShow then writeln(Align(entryPrice,6),tPrice,' ',
       Copy(DateToString(Bar(eDate,j)),1,5),
       Format('  %3.0f  Winner%6.0f',n,pObject/n));
     end;

     if b and ((j-SignalDate)>ex) then begin     {-- test for TIME exits --}
      fValue:=fValue+v; 
      n:=j-signalDate-1; if n<1 then n:=1;
      inc(fCount); fDays:=fDays+n; z:=n; if z<5 then z:=5;
      fRate:=fRate+v/z; b:=false;
      for z:=vi+501 to 1500 do SetArray(z,vArray(z)+v);
      if bShow then Writeln(Align(entryPrice,6),tPrice,
       Align(Last(j)/100,6),Format('%5.0f%8.0f%6.0f <TIME>',n,v,v/n));
     end;
    end;  {j bar loop on chart}
 
    if b then begin     {-- Watch these, they are near price targets --}

{    Alert(eSet,stopLossPrice*100);}
{    Alert(eSet,targetPrice*100); }

     oValue:=oValue+v; 
     n:=BarEnd-signalDate-1; if n<1 then n:=1;
     inc(oCount); oDays:=oDays+n; z:=n; if z<5 then z:=5;
     oRate:=oRate+v/z;
     if bShow then Write(Align(entryPrice,6),tPrice,Align(Last(BarEnd)/100,6),
      Format('%5.0f%8.0f%6.0f',n,v,v/n));
     if (Last(BarEnd)>=targetPrice*75) and b then begin
      n:=100-(Last(BarEnd)/targetPrice);
      if bShow then Writeln(Align('T-'+IntToStr(n)+'%',6)); b:=False;
     end;
     if (Last(BarEnd)<=stopLossPrice*75) and b then begin
      n:=100-(Last(BarEnd)/stopLossPrice);
      if bShow then Writeln(Align('S+'+IntToStr(n)+'%',6)); b:=False;
     end;
     if b then if bShow then Writeln();
    end;

    if not bPosition then begin    {print information about missed traded}
     inc(nCount); n:=BarEnd-signalDate-1; if n<1 then n:=1;
     v:=(Last(BarEnd)/100-entryPrice)/entryPrice*dl;
     if bShow then writeln(Align(entryPrice,6),tPrice,Align(Last(BarEnd)/100,6),
      Format('%5.0f%8.0f%6.0f',n,v,v/n),' <____');
    end;
   end; {valid symbol}
  end;  {i symbols in account}

  if bShow then Writeln();
  twCount:=twCount+wCount; tsCount:=tsCount+sCount;
  toCount:=toCount+oCount; tfCount:=tfCount+fCount;
  tnCount:=tnCount+nCount;
  toValue:=toValue+oValue;
  tfValue:=tfValue+fValue;
  twDays:=twDays+wDays; tsDays:=tsDays+sDays;
  toDays:=toDays+oDays; tfDays:=tfDays+fDays;
  twRate:=twRate+wRate; tsRate:=tsRate+sRate;
  toRate:=toRate+oRate; tfRate:=tfRate+fRate;

  Writeln(Format('Total %4.0f        Objective      Amount    Days    Rate',
   wCount+sCount+oCount+fCount+nCount));
 
  if nCount>0 then Writeln(Format('%5.0f No Trades',nCount));
 
  if wCount>0 then
   Writeln(Format('%5.0f Winners     @ $%5.0f =%11.0f   %5.0f %7.0f',
    wCount,pObject,wCount*pObject,wDays/wCount,wRate/wCount));
  
  if sCount>0 then
   Writeln(Format('%5.0f Stop Outs   @ $%5.0f =%11.0f   %5.0f %7.0f',
    sCount,-sObject,-sCount*sObject,sDays/sCount,-sRate/sCount));

  if fCount>0 then
   Writeln(Format('%5.0f Time Outs value      =%11.0f   %5.0f %7.0f',
    fCount,fValue,fDays/fCount,fRate/fCount));

  if oCount>0 then
   Writeln(Format('%5.0f Open Positions value =%11.0f   %5.0f %7.0f',
    oCount,oValue,oDays/oCount,oRate/oCount));

  z:=wCount+sCount+oCount+fCount;
  if z>0 then x:=(wRate+sRate+oRate+fRate)/z else x:=0;
  tRate:=tRate+x; z:=wCount*pObject-sCount*sObject+oValue+fValue;
  Writeln(Format('                     TOTAL $%11.0f    Rating=%5.0f',z,x));
 end;   {m all accounts}

 Writeln();
 Writeln(
  'SUMMARY ------------------------------------------------------------------------');
 Writeln('');
 Writeln(Format('Total %4.0f        Objective      Amount    Days    Rate',
  twCount+tsCount+toCount+tfCount+tnCount));
 x:=twCount*pObject; y:=-tsCount*sObject; z:=x+y+toValue+tfValue;

 if tnCount>0 then Writeln(Format('%5.0f No Trades',tnCount));
 
 if twCount>0 then
  Writeln(Format('%5.0f Winners     @ $%5.0f =%11.0f    %4.0f %7.0f',
   twCount,pObject,x,twDays/twCount,twRate/twCount));

 if tsCount>0 then
  Writeln(Format('%5.0f Stop Outs   @ $%5.0f =%11.0f    %4.0f %7.0f',
   tsCount,-sObject,y,tsDays/tsCount,-tsRate/tsCount));

 if tfCount>0 then
  Writeln(Format('%5.0f Time Outs value      =%11.0f   %5.0f %7.0f',
   tfCount,tfValue,tfDays/tfCount,tfRate/tfCount));

 if toCount>0 then
  Writeln(Format('%5.0f Open Positions value =%11.0f    %4.0f %7.0f',
   toCount,toValue,toDays/toCount,toRate/toCount));
 
 Writeln(Format('                     TOTAL $%11.0f    Rating=%5.0f',z,
  tRate/nAccounts));
 Writeln('');
 Writeln('SIZE of Open Position    (weekly)');
 Writeln(
  '..20..19..18..17..16..15..14..13..12..11..10...9...8...7...6...5...4...3...2...1');
 for i:=0 to 19 do Write4(vArray(905+i*5)); Writeln('');
 for i:=0 to 19 do Write4(vArray(905+i*5)-vArray(900+i*5)); Writeln('');

 Writeln('');
 Writeln('VALUE of Account         (weekly)');
 Writeln(
  '..20..19..18..17..16..15..14..13..12..11..10...9...8...7...6...5...4...3...2...1');
 for i:=0 to 19 do Write4(vArray(1405+i*5)/dl); Writeln('');
 for i:=0 to 19 do Write4((vArray(1405+i*5)-vArray(1400+i*5))/dl); Writeln('');

 Writeln('');
 Writeln('CAPITAL Requirement      (weekly)');
 Writeln(
  '..20..19..18..17..16..15..14..13..12..11..10...9...8...7...6...5...4...3...2...1');
 for i:=0 to 19 do Write4(vArray(905+i*5)-vArray(1405+i*5)/dl); Writeln('');
 for i:=0 to 19 do Write4(vArray(905+i*5)-vArray(1405+i*5)/dl-
  vArray(900+i*5)+vArray(1400+i*5)/dl); Writeln('');

 if tp>0 then begin
  Writeln('');
  Writeln('WEEK target was reached');
  Writeln(
  '...1...2...3...4...5...6...7...8...9..10..11..12..13..14..15..16..17..18..19..20');
  for i:=0 to 19 do Write4(vArray(i)); Writeln('');
 end;
END;


Copyright © 2008 by Ensign Software, Inc.