![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Dec 2008
Posts: 33
Thanks: 0
Thanked 0 times in 0 posts
|
I would like help with the code needed to prevent trading on Friday after 3:30. My straegy runs from Sun at 6:00 until it closes out any open positions on Friday at 3:30 and I want to prevent new trades from kicking off Friday after 3:30.
Thanks |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Hello 561timw,
Here is a line that may used to check for this: bool myTradeFilter = Time[0].DayOfWeek != DayOfWeek.Friday && ToTime(Time[0]) <= 153000; Please see this link which can help working with DateTime objects: http://www.ninjatrader.com/support/f...ad.php?t=19292
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Senior Member
|
Quote:
Code:
if (Time[0].DayOfWeek == DayOfWeek.Friday && ToTime(Time[0]) >= 153000 && ToTime(Time[1]) < 153000 ) NinjaTrader.Gui.SuperDom.SuperDom.FlattenEverything();
Last edited by koganam; 03-07-2011 at 12:11 PM.
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compute Highest High between 9:30 AM and 10:30 AM | mgbloomfield | Indicator Development | 5 | 03-20-2013 04:26 PM |
| How long does it to load 30 Range Charts, 30 days of data | pehon | Connecting | 6 | 07-01-2010 10:43 AM |
| 9.30 open price, 4.30 close | diffused | Strategy Development | 3 | 01-20-2009 01:18 PM |
| Exit on Close exited 30 Minutes Early (instead of 30 secs) | wayneFH | Strategy Development | 6 | 04-28-2008 04:52 AM |
| $97.30 Sell-Stop Order Filled at $96.30! | davidfw1866 | ATM Strategies (Discretionary Trading) | 3 | 11-08-2007 06:43 AM |