NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

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.

Reply
 
Thread Tools Display Modes
Old 05-12-2011, 01:05 PM   #1
sosMsos
Member
 
Join Date: Aug 2010
Posts: 43
Thanks: 0
Thanked 0 times in 0 posts
Default no fills

When i open a chart, choose a strategy and enable it, i dont get any fills?
Whats might be the problem?
sosMsos is offline  
Reply With Quote
Old 05-12-2011, 01:14 PM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello sosMsos,

Quote:
When i open a chart, choose a strategy and enable it, i dont get any fills?
Whats might be the problem?
  • The conditions aren't true for entry.
  • You're not displaying trade executions.

If you want to test a basic strategy, use the provided SampleMACrossOver, and make sure PlotExecutions are enabled in the right click > Data Series screen. This should generally produce trades and show fills on the chart.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 05-12-2011, 01:53 PM   #3
sosMsos
Member
 
Join Date: Aug 2010
Posts: 43
Thanks: 0
Thanked 0 times in 0 posts
Default

ya executions are plotted.
What dos this mean:

  • The conditions aren't true for entry.
Backtesting works great

Here the strategy:



#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// Enter the description of your strategy here
/// </summary>
[Description("trendfollow2minchart")]
public class trendfollow2minchart : Strategy
{
#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
#endregion

/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
Add(PeriodType.Day, 1);
//Add("^TICK", PeriodType.Minute, 1);
Add(RSI(4, 0));
Add(RSI(9, 0));
Add(EMA(21));
Add(EMA(55));
Add(EMA(200));
Add(ATR(14));

CalculateOnBarClose = true;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (EMA(BarsArray[1], 21)[0] > EMA(BarsArray[1], 55)[0]
&& EMA(BarsArray[1], 55)[0] > EMA(BarsArray[1], 200)[0]
&& EMA(BarsArray[1], 55)[0] > EMA(BarsArray[1], 55)[1]
&& EMA(BarsArray[1], 200)[0] > EMA(BarsArray[1], 200)[1]
&& CrossBelow(RSI(4, 0).Avg, 30, 1))

{
if (BarsInProgress == 0)
EnterLong(DefaultQuantity, "");
}
// SetStopLoss("",CalculationMode.Ticks, (ATR(14)[0]) * (250), false);

// Condition set 2
if (CrossAbove(RSI(9, 0).Avg, 70, 1))
{
ExitLong("");
}
// Condition set 3
if (CrossBelow(RSI(4, 0).Avg, 78, 1))
{
ExitLong("");
}
// Condition set 3
if (CrossBelow(RSI(9, 0).Avg, 30, 15)
&& CrossAbove(RSI(9, 0).Avg, 45, 1))
{
ExitLong("");
}
}

#region Properties
#endregion
}
}
sosMsos is offline  
Reply With Quote
Old 05-12-2011, 03:22 PM   #4
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Quote:
What dos this mean:

The conditions aren't true for entry.
That means the signals aren't returning true to process orders.

If you are adding daily series to your strategy, you should look at the amount of data loaded on the chat to make sure there is enough. Check this in the Right Click > Data Series screen.

Check log tab of control center for any error messages.

In order to track what your strategy is doing, you can debug with Print() statements and TraceOrders output.

Use plenty of Print() statements to verify values are what you expect.

Add TraceOrders = true to your Initialize method and you can then view output related to strategy submitted orders through Tools > Output window.

It may also help to add drawing objects to your chart for signal confirmation. Additional help for these items is available at the following links:

Debugging your NinjaScript code.
TraceOrders
Drawing Objects.
NinjaTrader_RyanM is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Market Replay Fills vs Live Real Money Fills Lusitano Strategy Development 1 03-02-2009 09:38 AM
Partial Fills nfeldberg Strategy Development 2 08-26-2008 09:23 AM
Trade Fills naifwonder Strategy Development 1 08-21-2008 12:14 PM
Partial Fills SystemTrading Miscellaneous Support 1 08-20-2008 08:43 AM
Partial Fills Harry ATM Strategies (Discretionary Trading) 5 02-26-2008 06:25 AM


All times are GMT -6. The time now is 07:39 PM.