(Solved) - Newly created Strategy does not show in Strategy window

Hello,

I’m trying to create an automated strategy using a script. Everything seems to work correctly, or at least the code compiles without errors. But there must be something I’m missing that’s not showing the created strategy in the strategy window.

I’m fairly new to code, I have some knowledge and can understand what’s written, but I can´t deduce more in deep situations.

For this strategy, I basically copied and pasted the “SampleAtmStrategy” available with NinjaScript so the script could create the AtmStrategy I wanted. Then, I added an instance of an indicator inside (State == State.DataLoaded) with its values, as is also the case with the “SampleMACrossOver” strategy. I also added the indicator declaration at the beginning.

But once compiled, it doesn’t show up in the strategy window. I read the documentation, and it looks I am doing it correctly. I aslo tried exporting and importing the file, but nothing happens.

I would really apreciate any help. Thank you.

I’m not entirely sure, but maybe it’s conflicting if you leave the Name the same.

	if (State == State.SetDefaults)
	{
		Description	= Custom.Resource.NinjaScriptStrategyDescriptionSampleATMStrategy;
		Name		= Custom.Resource.NinjaScriptStrategyNameSampleATMStrategy;
		// This strategy has been designed to take advantage of performance gains in Strategy Analyzer optimizations
		// See the Help Guide for additional information
		IsInstantiatedOnEachOptimizationIteration = false;
	}
1 Like

I tried changing the description and name, but it creates compilation errors.

Can’t help if I can’t see your code. You need to make sure it’s a string.

Wait, I just commented the description and name line and it does show now. Thank you for the help!

You probably want the name in there. It should be used for displaying when you select it.

It does display with the correct name, it just copy the script name.