![]() |
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
|
|||||||
| Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Sep 2008
Location: Old Lyme, CT
Posts: 108
Thanks: 0
Thanked 0 times in 0 posts
|
My strategy is now ready to run. I would like to backtest it and would appreciate help with the following issues:
1-How set session begin/end times for EURUSD that starts 5:30 pm Sunday and ends 5:30 pm Friday? 2-How to specify commission? (Assume spread for EURUSD is 3 pips.) 3-How set "Exit on Close"? 4-One of my parameters is maximumLoss which has a default setting of -$150. When I enter that value it automatically changes to 1? 5-I am currently connected to both TradeStation and Gain Capital. However, although time period is set to 1/1/09 to today and 30 minute interval, I can't get the chart or the backtest to recognize those settings. Historical data doesn't show and trades don't show on chart. |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
1. You set a start time and an end time for a day at a time. You cannot set it from Sunday to Friday. If you have some more specific needs then you should instead set it to 24 hrs sessions and program time filtering as need be.
2. You need to set this up in the Instrument Manager and be sure to select "Include commissions" when you run your strategy. 3. When you run your strategy please set it to true. 4. You need to change your code. Your code is stating minimum value for it is 1 in the Properties region for that parameter. 5. Please only connect to the data provider you wish to try and retrieve data from first. GAIN does not provide you that amount of historical data.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Sep 2008
Location: Old Lyme, CT
Posts: 108
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks for all the help.
In the Trades Tab in the Conrol Center, I have 7 trades. Although the Profit and Loss entries are red for losses and black for gains, all the amounts are zeros. How do I correct this? |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
You will need to look at the executions tab and correlate what your gains and losses actually are and try to correlate them back to what your trades are.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Sep 2008
Location: Old Lyme, CT
Posts: 108
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks for your reply.
I have just backtested my strategy. The performance report shows profit/loss on each trade as zero. However, it is obvious from the entry and exit prices that almost every trade is either plus or minus dollars. Since profitability is the only reason for trading, one would expect the performance to be expressed in dollars. How can I correct this? |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Please ensure you are trading with enough quantity. In forex with prices being off to 4 decimal places, you can get trades that seemingly don't net anything.
Please see this article: http://www.ninjatrader-support.com/H...ngFXStrategies
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Sep 2008
Location: Old Lyme, CT
Posts: 108
Thanks: 0
Thanked 0 times in 0 posts
|
My strategy is running simulated EURUSD 30 min.
A trade description shows S.LRx 0.1M@1.4120, 1-Is 0.1M $100,000? $10,000? $1,000? 2-How can I change this? (I am using data from TradeStation. When I enter trades, I use 1 for 1 contract.) The last trade shows as 0930 June 4. There are no entries on the chart after 1100 am June 5. 3-How can I bring the chart up to today’s date? In a backtest, all values show as zero. Quantity is set as 100,000. 4-What am I not doing correctly? |
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 976 times in 959 posts
|
Skat100,
1. This is one regular lot of 100K 2. In the backtest try entering 100000 to trade a full lot as in 1 3. You would need to import a fresh set of historical data to backfill the chart to the point where you connect to realtime data. http://www.ninjatrader-support.com/H...ownloader.html Most likely you would need to make sure all data is present before you backtest, and then enter the correct quantity to generated the trade staticstics related to the current lotsize you're looking for.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Sep 2008
Location: Old Lyme, CT
Posts: 108
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks for your reply.
Historical data is present back to 1/1/2009. Quantity is set to 100000. One problem is that the chart shows no data after 6/5. There is one burst of trade activity for a few days in May and on June 1. Otherwise, there are no trades showing. The performance chart shows all zeros. How do I correct these problems? |
|
|
|
|
|
#10 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 976 times in 959 posts
|
Please export the data and check that really all the needed historical data is present in your symbol, if not - you would then need to do a fresh data import. Have you backtested also with the SampleMACrossOver strategy?
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Sep 2008
Location: Old Lyme, CT
Posts: 108
Thanks: 0
Thanked 0 times in 0 posts
|
I have followed all your suggestions.
After running the Backtest Performance Report, the profit / loss figures do not make sense. For example, trade # 51 shows entry on a short sale at 1.3387 with an exit at 1.3350 and a profit of $0.04. In pips the profit was 37. In dollars that would be $370.00, not $0.04. How can I troubleshoot this? |
|
|
|
|
|
#12 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
What quantity did you submit at? 100,000 quantity = 1 lot. Please show us exactly what you are seeing in the Strategy Analyzer with a screenshot for a run off of the SampleMACrossOver strategy. Thank you.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#13 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Please provide a screenshot of the Strategy Analyzer showing the issue. Thank you.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#14 |
|
Senior Member
Join Date: Sep 2008
Location: Old Lyme, CT
Posts: 108
Thanks: 0
Thanked 0 times in 0 posts
|
1-When I started today, I opened a EURUSD chart. Data from 2:48 am to 11:46 am is missing. I re-imported the data but the data is still missing.
2-I tried to add my stategy to the chart but "Strategies" on the tool bar is greyed out. Control S does not work. I have been trying for several weeks now to translate a TradeStation strategy to Ninja. This has been an agonizing experience. I would like to make a suggestion. All the controls needed to develop and operate a strategy are in different places. Why not create a dashboard which collects appropriate collections of instructions for each task? This would not be a big programming job. It would simply be a layout job plus links. Thanks for your help. I do appreciate the rapid responses. |
|
|
|
|
|
#15 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 976 times in 959 posts
|
skat100, just to clarify for the TradeStation connection this is expected - when you're not connected 24 hrs live collecting data, you would need to reload this historical data using the TS Data Download strategy. Please export the data from the EURUSD symbol and check if it's present as you expect. If not delete the data and export a fresh generated txt file from TradeStation.
Do you have the ChartTrader panel enabled by any chance? This will prevent the strategies button from being available. Thanks for the suggestions!
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unable to backtest | cowcool | Strategy Analyzer | 1 | 05-31-2009 11:01 AM |
| BackTest Settings ??? | RJay | Strategy Analyzer | 2 | 03-11-2009 02:47 PM |
| Help with backtest | Bluemaze | Strategy Development | 1 | 01-31-2009 08:35 AM |
| Backtest a strategy | jriverac | Strategy Development | 5 | 05-23-2008 03:30 AM |
| Backtest not available | BradB | Strategy Analyzer | 9 | 11-10-2007 09:41 PM |