![]() |
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
Join Date: Apr 2012
Posts: 15
Thanks: 1
Thanked 1 time in 1 post
|
Hi,
I'm new in this forum so I hope I won't ask something too basic or that was already answered in the past. I want to backtest a system that has multiple exits. One exit is activated market on close on the day before the earnings report to avoid gaps against the trend. Does anyone know how to code it and what source of information can be used to it? Thanks, ACP |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello ACP,
Welcome to the forum and I am happy to assist you. You can limit the timing of your trades using a time filter. Please refer to this sample code which demonstrates it http://ninjatrader.com/support/forum...ead.php?t=3226 Please let me know if I can assist you any further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Apr 2012
Posts: 15
Thanks: 1
Thanked 1 time in 1 post
|
Hello Joydeep,
Thanks for your quick answer. I'm not looking for a predefined time exit but for an exit that depends on the day of the earnings report (ER) date. Trying to clarify my idea: If I buy ABC stock and while on the trade the company will present their ER I want the position to be closed on the previous day. I want to include this exit on a code for backtest. At the moment, manually I see this information on yahoo http://biz.yahoo.com/research/earncal/20110112.html but I suppose I can't get this data on NT. Hope you can help me. ACP |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello ACP,
The sample code is just a reference point/code and not the actual code. You have to hardcode the date(s) and further custom code it. in variable Code:
DateTime agmDate = new DateTime(2012, 5, 30, 15, 30, 0); Code:
if (Time[0] > agmDate)
{
//exit postions
}
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 |
| Earnings Data | ErikHR | NinjaScript File Sharing Discussion | 5 | 09-12-2011 09:20 AM |
| Position does not close | Torso | Strategy Development | 1 | 10-26-2010 12:56 PM |
| Automatically enter position on Market Open, Close position on Market Close | kevendickenson | SuperDOM and other Order Entry Windows | 1 | 04-02-2010 04:30 AM |
| Can we display dividends & earnings information on Chart? | isitpossible | Charting | 3 | 03-29-2010 10:32 PM |
| position close on close of bar | mballagan | Miscellaneous Support | 3 | 01-14-2010 10:11 AM |