namespace NinjaTrader.NinjaScript.Strategies.Jorge
{
public class JorgeStrategySMA : Strategy
{
private ISeries<double> wma;
private Series<double> barVolume;
private double currentVolume;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Strategy here.";
Name = "JorgeStrategySMA";
Calculate = Calculate.OnBarClose;
EntriesPerDirection = 1;
EntryHandling = EntryHandling.AllEntries;
IsExitOnSessionCloseStrategy = true;
ExitOnSessionCloseSeconds = 30;
IsFillLimitOnTouch = false;
MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
OrderFillResolution = OrderFillResolution.Standard;
Slippage = 0;
StartBehavior = StartBehavior.WaitUntilFlat;
TimeInForce = TimeInForce.Gtc;
TraceOrders = false;
RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
StopTargetHandling = StopTargetHandling.PerEntryExecution;
BarsRequiredToTrade = 20;
IsExitOnSessionCloseStrategy = false;
// Disable this property for performance gains in Strategy Analyzer optimizations
// See the Help Guide for additional information
IsInstantiatedOnEachOptimizationIteration = true;
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
I cannot see a copied Strategy on the Analyzer or Chart
Collapse
X
-
I cannot see a copied Strategy on the Analyzer or Chart
I copied and changed the name of a strategy that I developed on NinjaScript. However, I cannot see it in the analyzer or chart. Can someone help, please?
Code:Tags: None
-
Hello Jorge.andres.o,
Thank you for your post.
First, have you made sure to compile your strategy?
A good first step here is to check the "Log" tab of the Ninjatrader Control center and look for any errors related to the strategies as if there is a run time error is would show in the log tab.
If there are no log errors, check (in the Ninjascript editor open each strategy) to see if the strategies have the same name (IE you made a copy of the strategy and made your changes but unintentionally left the name the same as an existing one).
In general, you want the filename of the strategy (this is what Ninjascript editor uses to open the script) to be the same as the public class name and most importantly that inside OnStateChange and within State.SetDefaults, the Name = field (This is what the drop-down or strategy selector uses) shows the same name as the public class name.
Looking at your code, the public class name and Name = field are the same. Does the filename match as well?
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
56 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
133 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
73 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
45 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
49 views
0 likes
|
Last Post
|

Comment