True FVG PIne to Proreal

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #243536 quote
    lukapex
    Participant
    New
    Hello! Here is my pinescript code for FVG. I would like to have it converted to proreal. Thank You in advance! Here is the picture and how it looks.

    //@version=5

    indicator(‘Moj FVG’, overlay = true, max_boxes_count = 500)
    // === Groups ===
    group_options = “Options”
    group_fvg_color = “FVG Color Settings”
    // === Inputs ===
    options = input.string(“ALL”, title = “Options”, options = [“ALL”, “FTR”, “FVG”], group = group_options)
    mark_type = input.string(“Box”, title = “Mark Type”, options = [“ALL”, “Box”, “Bar Color”], group = group_options)
    fvg_border_color = input.color(color.yellow, “Border Color”, group = group_fvg_color)
    fvg_bg_color = input.color(color.new(color.yellow, 90), “Bg Color”, group = group_fvg_color)
    fvg_bar_color = input.color(color.yellow, “Bar Color”, group = group_fvg_color)
    // === FVG ===
    fvg_up_gap = options != “FTR” and close[1] > open[1] ? low – high[2] : 0.0
    fvg_up_box=fvg_up_gap>0andmark_type!=”Bar Color”?box.new(left=bar_index[2],top=high[2],right=bar_index,bottom=low,border_color=fvg_border_color,bgcolor=fvg_bg_color) :na
    fvg_down_gap = options != “FTR” and close[1] < open[1] ? low[2] – high : 0.0
    fvg_down_box=fvg_down_gap>0andmark_type!=”Bar Color”?box.new(left=bar_index[2],top=low[2],right=bar_index,bottom=high,border_color=fvg_border_color,bgcolor=fvg_bg_color) :na
    barcolor(fvg_up_gap > 0 and mark_type != “Box” ? fvg_bar_color : na, offset = -1)
    barcolor(fvg_down_gap > 0 and mark_type != “Box” ? fvg_bar_color : na, offset = -1)
    #243545 quote
    JS
    Participant
    Senior

    There is a Fair Value Gap (FVG) available in the library…
    https://www.prorealcode.com/prorealtime-indicators/fvg-fair-value-gap-indicator/

    Iván González and lukapex thanked this post
    #243551 quote
    LaMaille
    Participant
    Junior
    FVGd = Low[2]-High > 0
    FVGm = Low-High[2] > 0
    
    If FVGd xor FVGm then
    y1 = FVGd*Low[2] + FVGm*High[2]
    y2 = FVGd*High + FVGm*Low
    Drawrectangle(barindex-2,y1, barindex,y2) style(line,1) Coloured("grey",30) bordercolor("yellow",200)
    Endif
    
    Return
    Iván González, lukapex and f1_maik thanked this post
    #243568 quote
    lukapex
    Participant
    New

    Thank you!

    #243569 quote
    lukapex
    Participant
    New

    Thank you!!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

True FVG PIne to Proreal


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
lukapex @lukapex Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by lukapex
1 year ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/06/2025
Status: Active
Attachments: 1 files
Logo Logo
Loading...