simulating MTF in an indicator

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #92270 quote
    Juan SalasJuan Salas
    Participant
    Master

    Hi everyone,

    I am trying to simulate the MTF in an indicator. My strategy is running default in 5′, combined with 1 hour entry signals, given by an custom made indicator.

    There is no problem whatsoever to run the strategy, but I would like to visualise the indicator (1 hour) at the same  5′ screen where the strategy is running.

    How could I simulate the 1 hour candles in a 5 mins TF????. I know is a basic piece of code, but I cannot find any example in the forums.

    Attaching the part of the indicator involved.

    // AVERG DOWN indicator
    
    defparam drawonlastbaronly= true
    
    // parameters
    rojo=open>close
    
    // Determinición niveles GRID
    IF time=020000 AND rojo THEN 
    levelZERO = close
    ENDIF
    
    IF time=030000 AND rojo AND NOT rojo[1] THEN
    levelZERO = close
    ENDIF
    
    IF time=040000 AND rojo AND NOT rojo[1] AND NOT rojo[2] THEN
    levelZERO = close
    ENDIF
    
    IF time=050000 AND rojo AND NOT rojo[1] AND NOT rojo[2] AND NOT rojo[3] THEN
    levelZERO = close
    ENDIF
    
    IF time=060000 AND rojo AND NOT rojo[1] AND NOT rojo[2] AND NOT rojo[3] AND NOT rojo[4] THEN
    levelZERO = close
    ENDIF
    
    IF time=070000 AND rojo AND NOT rojo[1] AND NOT rojo[2] AND NOT rojo[3] AND NOT rojo[4] AND NOT rojo[5] THEN
    levelZERO = close
    ENDIF
    
    IF time=080000 AND rojo AND NOT rojo[1] AND NOT rojo[2] AND NOT rojo[3] AND NOT rojo[4] AND NOT rojo[5] AND NOT rojo[6] THEN
    levelZERO = close
    ENDIF
    
    IF time=090000 AND rojo AND NOT rojo[1] AND NOT rojo[2] AND NOT rojo[3] AND NOT rojo[4] AND NOT rojo[5] AND NOT rojo[6] AND NOT rojo[7] THEN
    levelZERO = close
    ENDIF
    
    IF time=100000 AND rojo AND NOT rojo[1] AND NOT rojo[2] AND NOT rojo[3] AND NOT rojo[4] AND NOT rojo[5] AND NOT rojo[6] AND NOT rojo[7] AND NOT rojo[8] THEN
    levelZERO = close
    ENDIF
    
    // levels UP
    grid=20
    profitdiario=10
    
    levelfinal = level1up + grid*pipsize
    level1up = levelZERO + grid*pipsize
    levelprofit = levelZERO - profitdiario*pipsize
    
    RETURN LevelZERO as "levelZERO", level1up as "level1up", levelfinal as "levelfinal", levelprofit as "levelprofit"
    

    Thanks in advance,

    #92289 quote
    pableitorpableitor
    Participant
    Master

    Hi Juan,

    Pls check my indicator 🙂

    https://www.prorealcode.com/prorealtime-indicators/higher-time-frame-candlestick-on-a-lower-time-frame-chart/

    It lets you draw higher TF  in a 5 min. chart.  Hope it helps !

    Juan Salas thanked this post
    #92432 quote
    Juan SalasJuan Salas
    Participant
    Master

    Hi Pableitor,

    Thanks so much!! I will check the code and will keep it for any future use 😉

    Muchas gracias,

    Juan

Viewing 3 posts - 1 through 3 (of 3 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

simulating MTF in an indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Juan Salas @juan-salas Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Juan SalasJuan Salas
7 years, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/25/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...