Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Indicator could not be serialized
Collapse
X
-
Its a trick. There's two of them. Half a bottle of Merlot later I realized that SampleBoolSeries.zip has both a Strategy and Indicator in the example.
All is well. Thanks Josh
-
TAJTrades,
Please start by using exposed properties to access the internal DataSeries objects. The reference sample I posted earlier demonstrates how to do this with a BoolSeries. It is done exactly the same way for a DataSeries.
Leave a comment:
-
Josh,
I just opened a fresh chart and put the Indicator on it and then Closed the Work Space. Got the same Error Message.
I repeated the process this time only putting the Strategy that calls the Indicator and closed the Work Space with the Strategy still attached. Got NO error Message.
My best guess is that the issue is with the Indicator either with defining the DataSeries or or the .Set command
Back to the drawing board.
TJ
Leave a comment:
-
You should not create public DataSeries like that. Please check out this reference sample on how to expose DataSeries for use in strategies. http://www.ninjatrader-support.com/v...ead.php?t=4991
Leave a comment:
-
Josh,
"Is your indicator running on a chart somewhere? Please try removing the indicator from any running instances and see what happens."
When I removed the indicator and the strategy calling the indicator form the chart the workspace closed with NO error message.
Here is the situation:
- Indicator creates 2 DataSeries with values of 0 to 20 (integers, no decimals)
- Indicator creates Trend Lines on the chart.
- A Strategy calls the DataSeries for input into the Strategy with the line:
IndicatorV5(80,1,5,20,40,period1,period2,true).bea rishDivergenceCount[1];
Indicator results:
-Trend Lines are drawn as expected
-DataSeries values created as expected per the Output Window
- The Strategy is accessing the Indicator DataSeries as it is firing off trades in the Sim101 Account.
My guess is that I have not defined the DataSeries in a way that Ninja needs to have everything sync and accessible. I have defined the DataSeries as follows:
#region Variables
(Other Inputs);
public DataSeries bullishDivergenceCount; // DataSeries Bullish Divergence;
public DataSeries bearishDivergenceCount; // DataSeries Bullish Divergence;
#endregion
protected override void Initialize()
{
CalculateOnBarClose = true;
Overlay = true;
PriceTypeSupported = false;
bullishDivergenceCount = new DataSeries(this);
bearishDivergenceCount = new DataSeries(this);
}
protected override void OnBarUpdate()
{
// Lots of code creating DataSeries Values and Trend Lines
bullishDivergenceCount.Set(Value);
bearishDivergenceCount.Set(Value); // Value being an integer number assigned to that bar
}
#region Properties
nothing pertaining to the DataSeries
#endregion
Have I defined the DataSeries correctly to sync everything and give access to the Strategy?
Many thanks for your help.
Leave a comment:
-
Hi TAJTrades,
Is your indicator running on a chart somewhere? Please try removing the indicator from any running instances and see what happens. Then try removing the indicator from NinjaTrader altogether. Backup your code first. See what happens then.
If you still get the error then it is something with the code. Please upload the code here then we can take a quick glance through at it to see if we see anything out of the ordinary.
Leave a comment:
-
Indicator could not be serialized
Ninja Folks,
I created an indicator that compiled with no problems. However, when I tried to Save the Workspace I received the Error "Indicator could not be serialized. Please refer help for more information on serializing indicators". I hit the F1 (F1 and I have become very close friends) key and found nothing to help diagnose this issue.
Can you point me in the right direction?
ThanksTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by TradeForge, 04-19-2024, 02:09 AM
|
2 responses
28 views
0 likes
|
Last Post
by TradeForge
Today, 12:32 PM
|
||
Started by aprilfool, 12-03-2022, 03:01 PM
|
3 responses
327 views
0 likes
|
Last Post Today, 12:31 PM | ||
Started by giulyko00, Today, 12:03 PM
|
1 response
5 views
0 likes
|
Last Post Today, 12:25 PM | ||
Started by f.saeidi, Today, 12:14 PM
|
1 response
4 views
0 likes
|
Last Post Today, 12:25 PM | ||
Started by AnnBarnes, Today, 12:17 PM
|
1 response
2 views
0 likes
|
Last Post Today, 12:22 PM |
Leave a comment: