![]() |
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 |
|
Member
Join Date: Oct 2008
Posts: 60
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
I am getting this error when running my strategy. It complies fine and the strategy runs fine, but when an order is placed I get this error: Failed to execute DB job 'StrategyUpdateJob' There was an error reflecting typeTrader.StochScalpV3_1. There was an error reflecting property SessionEnd. Member of type Int32 hides base class member StrategyBase.SessionEnd of type System.DateTime. Use XmlElementAttribute or XmlAttribueAttributr to specify a new name. Here is how I use the variable sessionEnd: As a parameter: Code:
[Description("Session End Time (format HHMMSS)")]
[Category("Parameters")]
public int SessionEnd
{
get { return sessionEnd; }
set { sessionEnd = value; }
}
Code:
private void checkTradingHours()
{
currentTime = ToTime(Time[0]);
if (currentTime <= sessionStart || currentTime >= sessionEnd )
withinTradingHours = false;
else withinTradingHours = true;
}
|
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Please try using a different variable name. SessionEnd may be reserved.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Oct 2008
Posts: 60
Thanks: 0
Thanked 0 times in 0 posts
|
Great, that worked thank you.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| backtesting and DateTime.Now | andrewbee | Strategy Analyzer | 3 | 06-28-2010 09:18 AM |
| DateTime.Now vs Market Replay | ATI user | Strategy Development | 3 | 11-15-2008 07:35 PM |
| Integer Output | Faspomy | Indicator Development | 7 | 11-03-2008 10:32 AM |
| Rounding off to an integer? | Burga1 | General Programming | 1 | 01-02-2008 10:20 PM |
| error combining ema with an integer | Thomas | Strategy Development | 3 | 08-16-2007 05:40 AM |