Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with coding

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

    Help with coding

    I think I posted this in the wrong place so I am posting again here. This is TS code for an indicator that plots as a dotted horizontal line. The dots change color when the programmed time changes. I was hoping someone could code it for all who wish to use it. Thanks

    LegacyColorValue = true];
    { This indicator plots colored dots at the bottom of your subgraph to note the different
    timezones. Default colors are:

    Red: Dead Zone
    Green: Trade Zone
    Yellow: Reversal Zone
    Grey: After Hours
    Note: This indicator will work in either local time or exchange time anywhere in the world.
    However it will only work with exchanges that open at 9:30 EST. Therefore it cannot be
    used on 24 Hour Globex charts. A modification needs to be made to account for this.
    }
    inputs: isGlobex(True);
    vars: TimeOffset( 0 ),
    curTime( 0 );

    TimeOffset = TimeToMinutes( 615 ) - TimeToMinutes(Sess1StartTime);
    if( isGlobex ) then TimeOffset = TimeOffset + TimeToMinutes (0715 );
    curTime = CalcTime( Time, TimeOffset );
    { No Trade Zones }
    If (curTime > 0630 and curTime <= 0650) or (curTime > 0815 and curTime <= 0855)
    or (curTime > 0905 and curTime <= 1025) or
    (curTime > 1035 and curTime <= 1115 ) then
    Plot1( 0, "NoTrade Zone" ) ;
    {Trade Zones}
    If (curTime > 0710 and curTime <= 0725 )or (curTime > 0730 and curTime <= 0815) or
    (curTime > 1115 and curTime <= 1200 )or (curTime > 1210 and curTime <= 1225) or
    (curTime > 1230 and curTime <= 1240 )or (curTime > 1245 and curTime <= 1300 ) then
    Plot2(0, "Trade Zone" ) ;
    {Reversal Zones}
    If (curTime > 650 and curTime <= 710 ) or (curTime > 725 and curTime <= 730) or
    (curTime > 855 and curTime <= 905 ) or (curTime > 1025 and curTime <= 1035) or
    (curTime > 1200 and curTime <= 1210 ) or (curTime > 1225 and curTime <= 1230) or
    (curTime > 1240 and curTime <= 1245 ) then
    Plot3( 0,"Reversal Zone");
    If ( curTime >= 1300 and curTime <=2400 ) or ( curTime >= 0000 and curtime <= 630 )
    then
    Plot4 ( 0, "Night Zone");

    #2
    You can always contact one of our NinjaScript consultants to check if they can convert the indicator for you. You can find them at the link below.
    JasonNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by WHICKED, Today, 12:45 PM
    2 responses
    18 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by GussJ, 03-04-2020, 03:11 PM
    15 responses
    3,276 views
    0 likes
    Last Post xiinteractive  
    Started by Tim-c, Today, 02:10 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Taddypole, Today, 02:47 PM
    0 responses
    5 views
    0 likes
    Last Post Taddypole  
    Started by chbruno, 04-24-2024, 04:10 PM
    4 responses
    51 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Working...
    X