STOCKS & COMMODITIES magazine. The Traders' Magazine

Register or Log In — Traders.com and STOCKS & COMMODITIES magazine

  |  NOV 1988

{Put}, @Index vs. Copy by A.O.T. Fayiga, M.D.

{Put}, @Index vs. Copy by A.O.T. Fayiga, M.D. When writing macros in Lotus 1-2-3, one always tries to find the programming method that runs the fastest. But complexity is not synonymous with speed. Sometimes, using {Put}, @Index, and {For} loops saves you a lot of time, but when the formula you are using is fixed, you will find that a macro using the Copy command runs much faster. As an exercise, we can use the recent series of S&C articles by Jim Summers that developed Lotus programming for J. Welles Wilder's true range (TR1) and Directional Movement Index (DMI). (The column described static and dynamic loops using {Put} and @Index commands in the July 1988 issue.) Using the Copy command and range names, the macro in Figure 1 runs about six times faster than a complicated {Put}, @Index and {For} loop which serves you best when you have a truly dynamic macro in which the contents of lines are changing as the loop executes. To try the Copy method, make a copy of the TR1 file developed in Summers' columns and give it a different name (I call mine MYTR1 .WK 1). Delete the range names Process, Ctr0, Ctr1 and Ctr3 that you will not be using in this method and assign the range names in Figure 2. Erase the current lines in macro \x and enter the macro shown in Figure 1. Then enter the following formulas in the designated cells. Below each formula, I have described what you should see in the control panel after pressing Edit, but just with your cell-pointer in each of these cells, you see how you are calculating the TR1, +DMI and -DMI. Nested @If commands are used in F242 and G242. The F242 formula is the +DMI on an up-day/outside up-day. G242 is the -DMI on a down-day/outside down day:

by A.O.T. Fayiga, M.D.

Technical Analysis of STOCKS & COMMODITIES
The Traders’ Magazine since 1982
has had over 1,226,237 subscribers from 174 different countries.
37,000 Page Traders’ Archive for $89.99

NOT A SUBSCRIBER?

To continue reading, sign-up for trial access to Traders.com and the S&C Archive37,000 pages of trading ideas!




After verifying your email address, you will have limited access to the S&C Archive, as well as access to a Digital Edition of S&C, and access to Traders.com Advantage and Working Money for 30 days.



DEPARTMENTS: Advertising | Editorial | Circulation | Contact Us | BY PHONE: (206) 938-0570

PTSK — The Professional Traders' Starter Kit
Home — S&C Magazine | Working Money Magazine | Traders.com Advantage | Online Store | Traders’ Resource
Add a Product to Traders’ Resource | Message Boards | Subscribe/Renew | Free Trial Issue | Article Code | Search

Copyright © 1982–2024 Technical Analysis, Inc. All rights reserved. Read our disclaimer & privacy statement.