One System From The Book

Just wanted to bring one of the systems that I developed for the book to everybody’s attention. This is a simple system that puts on two contracts and peels one off after a certain profit and then lets the other one ride. Its a mini-Russell system. Full code is disclosed in the book – source code can be imported into other applications.  The object of this code is to demonstrate multiple contracts and money management techniques.  Remember –

THERE IS A SUBSTANTIAL RISK OF LOSS IN TRADING. IT IS IN THE NATURE OF COMMODITY TRADING THAT WHERE THERE IS THE OPPORTUNITY FOR PROFIT, THERE IS ALSO THE RISK OF LOSS. COMMODITY TRADING INVOLVES A CERTAIN DEGREE OF RISK, AND MAY NOT BE SUITABLE FOR ALL INVESTORS. PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS.
THE HIGH DEGREE OF LEVERAGE THAT IS FOUND IN FUTURES (BECAUSE OF SMALL MARGIN REQUIREMENTS) CAN WORK AGAINST YOU AS WELL AS FOR YOU. I.E. YOU CAN HAVE LARGE LOSSES AS WELL AS LARGE GAINS.

GeoRussell

This Code Uses A Loop To Calculate Buy/Sell Levels Based on Current Position

Instead of doing this:

if currentshares = LTT then begin 
 buy("B-20A.5") LTT shares next bar highest(h,20)[BB] + (0.5*N) or higher; 
 buy("B-20A 1") LTT shares next bar highest(h,20)[BB] + (1.0*N) or higher; 
 buy("B-20A1.5") LTT shares next bar highest(h,20)[BB]+ (1.5*N) or higher; 
 end; 
 if currentshares = LTT * 2 then begin 
 buy("B-20B 1") LTT shares next bar highest(h,20)[BB] + (1.0*N) or higher; 
 buy("B-20B1.5") LTT shares next bar highest(h,20)[BB] + (1.5*N) or higher; 
 end; 
 if currentshares = LTT * 3 then 
 buy("B-20C1.5") LTT shares next bar highest(h,20)[BB] + (1.5*N) or higher; 
end;

Just do this:

for iCnt = 0 to 3
begin
	if lastTradeLoser then
	begin
		if mp <> -1 and currentContracts = iCnt * lotSize then
		begin
			buyPrice = hh20 + iCnt * N/2;
		end;		
	end;
end;
if lastTradeLoser then
begin
	if currentContracts < 4 * lotsize then Buy ("Turtle20Buy") lotSize contracts next bar at buyPrice stop;
end;

Instead of having multiple buy orders at different levels -simply change your buy levels using the for-next loop and issue just one order. Only problem is you can only issue one buy order per bar. Whereas the former approach will place multiple orders for the next bar. Usually this will not cause a problem unless your buy/sell levels are very close. The use of the for-next loop is up to one's own programming style. I like the for-next loop.