![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
|
I am developing a strategy that takes a trade at a very specific time. Let's say 11:05 am Pacific Time.
I have code as follows Code:
private void TakeTrade()
{
TimeSpan timeToTakeTrade = new TimeSpan(11, 5, 0);
DateTime Min5Time = Times[1][0];
if (BarsInProgress == 1) // 5 minute bars
{
if (Min5Time.TimeOfDay.CompareTo(timeToTakeTrade) == 0)
ProcessTrade();
}
else if (BarsInProgress == 0) // daily bars
{
// do nothing
}
}
What do I need to do to set the timeToTakeTrade value correctly? Do I get the timezone from the user's computer or is there a better way? Thanks
Last edited by ExactlyMyPoint; 02-18-2011 at 01:57 PM.
|
|
|
|
| Tags |
| time zone |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| TimeZone | gg80108 | Strategy Development | 7 | 01-28-2011 09:58 AM |
| Changing TimeZone | Joerg | Miscellaneous Support | 1 | 11-26-2009 12:07 PM |
| Timezone | atrader101 | Miscellaneous Support | 5 | 04-06-2009 05:30 PM |
| how to change timezone? | incrediblefx | Charting | 4 | 08-28-2008 10:37 AM |
| What Timezone is ET? | Antraman | ATM Strategies (Discretionary Trading) | 3 | 01-02-2006 01:44 AM |