#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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
558 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
324 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
545 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment