Rank: Newbie
Groups: Registered, Registered Users Joined: 1/6/2007(UTC) Posts: 6
|
Hi Jose
Your last code could be nice like an indicator but what about for an exploration?
I would like to run an exploration in order to investigate a big number of conditions using only ONE formula.
I also want the output number to give me 2 kind of information. Quantitative = how many of these conditions are true or false and qualitative = which of them are true or false.
In my opinion there is only one way to arrive at this result. I must use the sequence of the decimal system numbers 1, 2,4,8,16,32 …etc
First step: Create the code for investigate 4 conditions
{4 Conditions)
Cond1:=If(C>Ref(C,-1), 1, 0);
Cond2:=If(V>50000, 2, 0);
Cond3:=If(RSI(14)>50, 4, 0);
Cond4:=If(AroonUp(14)>50, 8, 0);
Allcnds:=cond1 + cond2 + cond3 + cond4;
Second step: Create the code for make the correspondence between the decimal system numbers and the binary system numbers (In this example only for 4 conditions - parameters)
{Convert decimal to binary}
bin:=If(Allcnds=1,1,
If(Allcnds=2,10,
If(Allcnds=3,11,
If(Allcnds=4,100,
If(Allcnds=5,101,
If(Allcnds=6,110,
If(Allcnds=7,111,
If(Allcnds=8,1000,
If(Allcnds=9,1001,
If(Allcnds=10,1010,
If(Allcnds=11,1011,
If(Allcnds=12,1100,
If(Allcnds=13,1101,
If(Allcnds=14,1110,
If(Allcnds=15,1111,
0)))))))))))))));
Third step: Create the code for return back to decimal system numbers
{Convert binary to decimal}
dec:=If(bin=1,0001,
If(bin=10,0002,
If(bin=11,0012,
If(bin=100,0003,
If(bin=101,0013,
If(bin=110,0023,
If(bin=111,1230,
If(bin=1000,0004,
If(bin=1001,0014,
If(bin=1010,0024,
If(bin=1011,0124,
If(bin=1100,0034,
If(bin=1101,0134,
If(bin=1110,0234,
If(bin=1111,1234,
0)))))))))))))));
dec
Run the exploration
If one security obtains the decimal value 1234, all conditions are true.
If one security obtains the decimal value 123, cond1, cond2 and cond3 are true and cond4 is false.
If one security obtains the decimal value 12 cond1 and cond2 are true and cond3 and cond4 are false….etc
Dionusos
|