Indicador con dos valores

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #17096 quote
    RafaelNRafaelN
    Moderator
    Senior

    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

    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:

    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"
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Indicador con dos valores


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
RafaelN @rafaeln Moderator
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 11/24/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...