A continuación una solicitud que ha sido enviada a ProRealtime:
Soy usuarion premium de prorealtime y tengo una duda que no consigo resolver, la cuestion es la siguiente:
quiero programar un indicador que solo tiene 2 valores 0 y 10, por defecto el valor seria cero, pero cuando cumpla 4 condiciones se active el valor 10, y que mantenga ese valor mientra cumpla la primera condicion aunque ya no cumpla las otras 3. Gracias de antemano
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Ln = WeightedAverage [ 1 ] (CCI [ 1350 ] (typicalPrice ))
Lg = WeightedAverage [ Round ((1350 / 16 )/ 4 )] (CCI [ Round (1350 / 16 )] (typicalPrice ))
MR = weightedaverage [ round ( sqrt (1350 / 2 ) ) ] ( (2 * weightedaverage [ round ( (1350 / 2 )/ 2 ) ] (typicalPrice )- weightedaverage [ round (1350 / 2 )] (typicalPrice )))
ML = weightedaverage [ round ( sqrt (1350 * 2 ) ) ] ( (2 * weightedaverage [ round ( (1350 * 2 )/ 2 ) ] (typicalPrice )- weightedaverage [ round (1350 * 2 )] (typicalPrice )))
c1 = (Ln > 50 )
c2 = (Lg < - 100 )
c3 = (Lg[ 2 ] > Lg[ 1 ] ) AND (Lg[ 1 ] < Lg)
c4= (MR > ML)
c6 = Ln< 50
IF c1 and c2 and c3 and c4 then
LL = 10
WHILE c1 DO
LL = 10
IF c6 then
BREAK
ENDIF
WEND
else
Largos = 0
Endif
Return LL as "LL"
Y una proposición de respuesta:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Ln = WeightedAverage [ 1 ] (CCI [ 1350 ] (typicalPrice ))
Lg = WeightedAverage [ Round ((1350 / 16 )/ 4 )] (CCI [ Round (1350 / 16 )] (typicalPrice ))
MR = weightedaverage [ round ( sqrt (1350 / 2 ) ) ] ( (2 * weightedaverage [ round ( (1350 / 2 )/ 2 ) ] (typicalPrice )- weightedaverage [ round (1350 / 2 )] (typicalPrice )))
ML = weightedaverage [ round ( sqrt (1350 * 2 ) ) ] ( (2 * weightedaverage [ round ( (1350 * 2 )/ 2 ) ] (typicalPrice )- weightedaverage [ round (1350 * 2 )] (typicalPrice )))
c1 = (Ln > 50 )
c2 = (Lg < - 100 )
c3 = (Lg[ 2 ] > Lg[ 1 ] ) AND (Lg[ 1 ] < Lg)
c4= (MR > ML)
//c6 = Ln<50
IF c1 and c2 and c3 and c4 then
LL = 10
elsif c1 and LL[ 1 ] = 10 then
LL= 10
else
LL= 0
endif
Return LL as "LL"