![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jun 2011
Location: Ireland
Posts: 184
Thanks: 32
Thanked 20 times in 19 posts
|
Hi all;
I have used 'DrawRegion' to fill between two plots but I want the fill to start and end at specific times. I have done the following: In the 'Initialize' I have: private DateTime zonestart; private DateTime zoneend; 'OnBarUpdate' zonestart = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 08, 30, 0); zoneend = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 15, 14, 0); DrawRegion("Zone", zonestart, zoneend, HighestHigh, LowestLow,Color.Empty, Color.Blue, opacity); I still have my plots/dataseries on the chart that I want to fill between but no fill. If I use '0' and 'CurrentBar' instead of 'zonestart' etc I get a fill but it doesn't terminate until midnight. The help file isn't particularly helpful as it only gives an example for 'BarsAgo'. I have tried putting in the times '083000' and '151400' but that doesn't work either. Also tried turning these into integers with 'int zonestartBarsAgo = GetBar(zonestart);' This didn't work either. What is the obvious answer I am missing please. Thanks; Ben. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello Ben,
Thanks for writing in and I am happy to assist you. If you change the code to as below can you get the right fill. Code:
this.DrawRegion("tag" + Time[0].Date.ToString(), zonestart, zoneend, Upper, Lower, Color.Blue, Color.Blue, 3);
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Joydeep for this post: |
|
|
|
#3 |
|
Senior Member
Join Date: Jun 2011
Location: Ireland
Posts: 184
Thanks: 32
Thanked 20 times in 19 posts
|
Thanks for your help ! Works perfectly.
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello Ben,
Glad to know everything is working fine at your end. Please let me know if I can assist you any further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Session start and end time | BobTN | Version 7 Beta General Questions & Bug Reports | 1 | 08-04-2010 04:10 PM |
| candle stick start time and end time | coffeedan | Charting | 5 | 05-19-2010 12:51 PM |
| Strategy Start Time and End Time | kaywai | Strategy Development | 1 | 03-24-2010 05:19 AM |
| Start & end times for FOREX | bmaltz | Charting | 3 | 05-02-2007 04:50 PM |
| Session Start/End Time | MindSabre | General Programming | 1 | 04-29-2007 12:29 AM |