[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

programming standards ?



PureBytes Links

Trading Reference Links

Dear List,
I guess most traders are only programmers out of neccesity and therefore
unfamiliar with some basics on programming.

Could we at least agree upon the following:

=> Do NOT use Condition1, Condition2, Condition3 etc.
Give a meaningfull name and take the small extra effort of the Vars:
HighBroken(False), LowCountReached(False) etc.

=> Do NOT use Value1, Value2  etc.
Better make it: Vars: MP(0),Prof(0);
Saves you typing (MP is shorter)

Ident your lines

If HighBroken Then Begin { adding comment is very helpful but make them
"mean" something }
     HighCount = HighCount +1; { Highcount now 1 more => doesn't help }
     Prof = 0; { Since High is now broken we reset the system and start with
no profits }
End
Else If LowCountReached Then
     LowCount = 0
Else
     HighCount = 0;


What does the following mean ?

If Condition32 Then Begin
Value12=Value12+1;
Value3=0;
End
Else
If Condition2 Then
Value1=0
Else
Value12=0;


Do I make my point ?
Believe me it will save you a lot of time when debugging or updating your
code.

Robert

ps. When you have something that functions in a generic way put it into a
userfunction (see NumericRef and other parameters).

===============================
Robert Linders
Orlando, FL
email: mugsnug@xxxxxxxxx
===============================