#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 charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
51 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
142 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
160 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
96 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
275 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment