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

Automate 'inputs' pending stock.



PureBytes Links

Trading Reference Links

Could anyone please help for a way to speed up the loading time when a
system has an extra facility to change the inputs (through variables).

The base system is quite fast (eg: doesn't depend on BarsAgo/MaxBarsBack
checking hardly at all and indicators etc are more or less non-existent).

There are five inputs to effect range, volume, dow etc (pending a stocks
price level, liquidity, and ranges re volatilty etc)

I have now incorporated the 'input' parameters for a number of stocks into 3
arrays, so as to enable stepping through stocks without having to manually
lookup and set their inputs. So;
-the stock code is sourced/checked in the first array.
-an index number for that stock is located in the next array.
-the index No. is then used to find the columns holding the 'Inputs' in the
last array.

The system uses an input ( AutoSym(0) ) to switch between using the default
inputs or checking for 'inputs' via the functions/arrays.

However, this greatly reduces the loading time.

See arrays and code below. I have tried two methods of coding. Neither help.
My guess is that the slowness is from my poor coding of the arrays, or the
method itself.

Could anyone suggest a faster method, please ?

Thanks
Jon Macmichael


<<<<< FUNCTION: sbbSymbChk >>>>>

Vars: asxcode("");
asxcode = GetSymbolName;

If asxcode = "AAT" or
asxcode = "ACU" or
asxcode = "ALZ" or
asxcode = "AVA" or
asxcode = "SBP" or
asxcode = "SRA" or
asxcode = "SSS" or
asxcode = "STN" or
asxcode = "TEL" or
asxcode = "WTP"

Then Condition1 =True
Else Condition1 =False;
If Condition1 =True then sbbSymbChk =True
Else sbbSymbChk =False;
 <<<<<>>>>>



<<<<< FUNCTION: asxNum >>>>>

Vars: asxcode("");

asxcode = GetSymbolName;

If asxcode = "AAT" then asxNum = 0 Else
If asxcode = "ACU" then asxNum = 1 Else
If asxcode = "ALZ" then asxNum = 2 Else
If asxcode = "AVA" then asxNum = 3 Else
If asxcode = "BRZ" then asxNum = 4 Else
If asxcode = "EQI" then asxNum = 5 Else
If asxcode = "FLO" then asxNum = 6 Else
If asxcode = "GFD" then asxNum = 7 Else
If asxcode = "HML" then asxNum = 8 Else
If asxcode = "ICS" then asxNum = 9;
 <<<<<>>>>>



<<<<< FUNCTION: SBBiNPUTS >>>>>

Input: RCSDV(String);
Vars: arrayColmn(0);
Array: SymInputs[63,5]("");

If RCSDV = "R" then arrayColmn =1 Else
If RCSDV = "C" then arrayColmn =2 Else
If RCSDV = "S" then arrayColmn =3 Else
If RCSDV = "D" then arrayColmn =4 Else
If RCSDV = "V" then arrayColmn =5;

SymInputs[0,0]="AAT";
SymInputs[0,1]="2.01";
SymInputs[0,2]="70000";
SymInputs[0,3]="0";
SymInputs[0,4]="9";
SymInputs[0,5]="2";
SymInputs[1,0]="ACU";
SymInputs[1,1]="1.01";
SymInputs[1,2]="5000";
SymInputs[1,3]="2";
SymInputs[1,4]="0";
SymInputs[1,5]="1";
SymInputs[2,0]="ALZ";
SymInputs[2,1]="2.01";
SymInputs[2,2]="5000";
SymInputs[2,3]="2";
SymInputs[2,4]="10";
SymInputs[2,5]="1";
 {and so on}
SymInputs[63,0]="WTP";
SymInputs[63,1]="2.01";
SymInputs[63,2]="25000";
SymInputs[63,3]="4";
SymInputs[63,4]="0";
SymInputs[63,5]="2";

SBBInputs = StrToNum(SymInputs[asxNum,arrayColmn]);
 <<<<<>>>>>




Inputs: RangeMax(0) etc;
Vars: sbbRange(0) etc;

<<<<< SYSTEM CODE: sample ONE >>>>>

If AutoSym = 0 then Begin
 sbbRange = RngeMax;
 sbbCash = CashReqd;
 sbbSpr = SprdFilt;
 sbbDow = DOW6notMon;
 sbbVol = BullishVol;
End
Else If sbbSymbChk = True then begin
 sbbRange = SBBInputs("R");
 sbbCash = SBBInputs("C");
 sbbSpr = SBBInputs("S");
 sbbDow = SBBInputs("D");
 sbbVol = SBBInputs("V");
End;


<<<<< SYSTEM CODE: sample TWO >>>>>

sbbRange = IFF(sbbSymbChk = True and AutoSym =1,SBBInputs("R"),RngeMax;
sbbCash = IFF(sbbSymbChk = True and AutoSym =1,SBBInputs("C"),CashReqd;
sbbSpr = IFF(sbbSymbChk =True and AutoSym =1,SBBInputs("S"),SprdFilt;
sbbDow = IFF(sbbSymbChk = True and AutoSym =1,SBBInputs("D"),DOW6notMon;
sbbVol = IFF(sbbSymbChk = True and AutoSym =1,SBBInputs("V"),BullishVol;

 <<<<<>>>>>