Model Scripting Help

Hi,

I’m currently working on a model building project that I have run into a snag on.

Model Overview:

  1. 27 Breadth indicators

Scoring:

Total number of Indicators on Pos signal / Total number of Indicators = % of indicators on Pos Signals

Total number of Indicators on Neg Signals / Total Number of Indicators = % of Indicators on Neg Signals

Model Score: % of Indicators on Buy Signals Less % of Indicators on Sell Signals = Net Buy (Sell) Signals

Example:

7 indicators on Pos Signals = (7/27) = 26%
20 Indicators on Neg Signals = (20/27) = -74%

Model Score = (26-74) = -48

(Possible Range +100 -100)

CODING:
Here is an example of the code that I have used on other models to get a scoring (+1,-1) for each indicator:

// NDX PERCENT >100SMA
NDX%100=GETDATA(CODE=NDX-A100MA.OB:BD);

// SET PARAMETERS
NDX100P1= NDX%100 CrossesAbove 80;
NDX100P2= NDX%100 CrossesBelow 20;

// SWITCH AND RES
NDX100S=SWITCH(NDX100P1,NDX100P2);
RES4=IF(NDX100S==1,1,-1);

This obviously will give a net score figure for all the model components, i.e (RES1+RES2+RES3+RES4 Etc).

It seems I need way to tally the # Pos Signals and the # Neg Signals individually in order to perform the math from above.

Any clues or help is greatly appreciated.
TIA