#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("Enter the description of your strategy here")]
publicclass a2tema : Strategy
{
#region Variables
// Wizard generated variables
privateint tp = 14; // Default setting for Tp
// 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>
protectedoverridevoid Initialize()
{
CalculateOnBarClose = true;
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protected oerride void OnBarUpdate()
{
if(Slope(TEMA(tp),tp,0 > 0 && Slope(TEMA(tp),tp,1 < 0)))
{
EnterLong("LONG");
}
if(Slope(TEMA(tp),tp,0 < 0 && Slope(TEMA(tp),tp,1 > 0)))
{
EnterShort("SHORT");
}
}
#region Properties
[Description("")]
[GridCategory("Parameters")]
publicint Tp
{
get { return tp; }
set { tp = Math.Max(1, value); }
}
#endregion
}
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
suddenly i cant compile
Collapse
X
-
suddenly i cant compile
I cant seem to get a clean compile of even the simplest files. the errors show as orange line instead of the normal beige and the error make no sense. asking for a ; on a section definitintion. what happened?here is the codeCode:Tags: None
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
81 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
64 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
66 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
54 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment