No consigo que lo dibuje

Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #247968 quote
    AmanavAmanav
    Participant
    New
    si, he entendido tu idea. Gracias. Lo que yo queria era lo siguiente: Si pongo 1 las dos lineas se mueven al mismo tiempo a: TargetPercentage1 = 1.025 // Target percentage 1 TargetPercentage2 = 0.975 // Target percentage 2 Si pongo 2 las dos lineas se mueven al mismo tiempo a: TargetPercentage1 = 1.050 // Target percentage 1 TargetPercentage2 = 0.925 // Target percentage 2 Si pongo 3 las dos lineas se mueven al mismo tiempo a: TargetPercentage1 = 1.075// Target percentage 1 TargetPercentage2 = 0.900 // Target percentage 2 asi todas las veces que quiera a diferentes niveles segun la volatilidad Pero no te preocupes, ya lo modificaré manualmente   Muchas gracias
    #247971 quote
    JSJS
    Participant
    Master
    Ningún problema, es mi pasatiempo favorito…
    En esta versión puedes configurar el “LayOut” en tres porcentajes diferentes…
    Si deseas añadir más, solo es cuestión de copiar y pegar…
    Amanav, robertogozzi and Iván González thanked this post
    OpenYear-plus-percentage-v5.itf
    #247990 quote
    AmanavAmanav
    Participant
    New
    Muchisimas Gracias JS, era exactamente esto. Además, me has enseñado a poner variables en la programación
    JS thanked this post
    #248114 quote
    AmanavAmanav
    Participant
    New
    Hola JS, Una pregunta. A veces los diferentes subministradores de datos, dan un precio de apertura diferente. Si quisiera poder una hora en concreto de apertura, o poner manualmente un precio de apertura, ¿podría hacerlo? Gracias
    #248186 quote
    JSJS
    Participant
    Master

    Hola,

    Lo que puede hacer es crear una nueva variable (booleana), por ejemplo, “xManual”, y cuando es igual a 1, entonces el código usa la entrada “manual” y cuando “xManual” es igual a 0, entonces se usa el código “normal”…

    DefParam DrawOnLastBarOnly=True
    
    xManual=1
    xOpenTime=143000
    xAnnualOpen=42000
    
    If xManual=1 then
    If OpenYear=2025 and OpenYear[1]=2024 and OpenTime=xOpenTime then
    AnnualIdx = barindex // Save the index of the opening bar
    AnnualOpen=xAnnualOpen
    If LayOut=1 then
    TargetLevel1 = Round(AnnualOpen + (AnnualOpen * 1/100),2)
    TargetLevel2 = Round(AnnualOpen - (AnnualOpen * 1/100),2)
    ElsIf LayOut=2 then
    TargetLevel1 = Round(AnnualOpen + (AnnualOpen * 1.5/100),2)
    TargetLevel2 = Round(AnnualOpen - (AnnualOpen * 1.5/100),2)
    ElsIf LayOut=3 then
    TargetLevel1 = Round(AnnualOpen + (AnnualOpen * 2/100),2)
    TargetLevel2 = Round(AnnualOpen - (AnnualOpen * 2/100),2)
    EndIf
    EndIf
    
    ElsIf xManual=0 then
    If OpenYear=2025 and OpenYear[1]=2024 then
    AnnualIdx = barindex // Save the index of the opening bar
    AnnualOpen=Open
    If LayOut=1 then
    TargetLevel1 = Round(AnnualOpen + (AnnualOpen * 1/100),2)
    TargetLevel2 = Round(AnnualOpen - (AnnualOpen * 1/100),2)
    ElsIf LayOut=2 then
    TargetLevel1 = Round(AnnualOpen + (AnnualOpen * 1.5/100),2)
    TargetLevel2 = Round(AnnualOpen - (AnnualOpen * 1.5/100),2)
    ElsIf LayOut=3 then
    TargetLevel1 = Round(AnnualOpen + (AnnualOpen * 2/100),2)
    TargetLevel2 = Round(AnnualOpen - (AnnualOpen * 2/100),2)
    EndIf
    EndIf
    EndIf
    
    Return TargetLevel1 as "TLevel1" Coloured("Brown")Style(Line,2), TargetLevel2 as "TLevel2" Coloured("Green")Style(Line,2),AnnualOpen as "AnnualOpen"Coloured("Purple")Style(Line,2)

    robertogozzi, Amanav and Iván González thanked this post
    OpenYear-plus-percentage-v6.itf
    #248212 quote
    AmanavAmanav
    Participant
    New
    Ok, voy a probarlo y te cuento que tal. Muchas gracias 🙂
    JS thanked this post
Viewing 6 posts - 16 through 21 (of 21 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

No consigo que lo dibuje


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
Amanav @amanav Participant
Summary

This topic contains 20 replies,
has 3 voices, and was last updated by AmanavAmanav
1 year, 3 months ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 06/03/2025
Status: Active
Attachments: 9 files
ProRealCode ProRealCode
Loading...