Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw Region between two values

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Draw Region between two values

    Hey guys,

    I am trying to use the draw,region function to highlight the area between 1 and 0.8 in my indicator panel but I face two errors. I looked these codes up but could not solve the issue. Can someone explain to me how to use the draw.region function properly ? Below you can find the part of the code which should include the statements. Many thanks in advance !

    if (L0[0] >= L1[0])
    cu = L0[0] - L1[0];
    else
    cd = L1[0] - L0[0];

    if (L1[0] >= L2[0])
    cu += L1[0] - L2[0];
    else
    cd += L2[0] - L1[0];

    if (L2[0] >= L3[0])
    cu += L2[0] - L3[0];
    else
    cd += L3[0] - L2[0];
    if (cu + cd != 0){
    LRSI[0] = (cu / (cu + cd));

    (Draw region should be included here)

    #2
    Hello muratb35, thanks for your post.

    All of the Draw.Region method overloads can be seen on the documentation page here:
    https://ninjatrader.com/support/help...t8/?region.htm

    Here are also some publicly available indicators that use Draw.Region:
    https://ninjatraderecosystem.com/use...load/repeater/
    https://ninjatraderecosystem.com/use...color-regions/
    https://ninjatraderecosystem.com/use...el-with-color/

    Please let me know if I can assist any further.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    66 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X