Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Export a Strategy with Indicator without source code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Export a Strategy with Indicator without source code

    I want to export a Strategy. This Strategy uses an Indicator without source code. When I'm trying to export the Strategy - I see the error. Please take a look at the screenshot. How can I export the Strategy correctly?

    #2
    Hello webus,

    Add a reference to the indicator assembly dll.

    From the drop-down select References. Then select the reference.

    After the package is exported, drag and drop the assembly dll into the export .zip file.

    Below is a link to a video that demonstrates.


    The links to the help guide don't show this specifically, but can still be helpful.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi NinjaTrader_ChelseaB,

      Sorry, but I see the same error when I'm trying to add the indicator as a Refference. ​
      Click image for larger version

Name:	References.jpg
Views:	428
Size:	29.6 KB
ID:	1231405

      Comment


        #4
        Hello webus,

        The error states that not all components have been added.

        What indicators or classes does your script call.

        Please list of all them.

        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi NinjaTrader_ChelseaB​,

          Originally posted by NinjaTrader_ChelseaB View Post
          Hello webus,

          The error states that not all components have been added.

          What indicators or classes does your script call.

          Please list of all them.
          The Strategy uses 'NordmanMainDivergencesIndicator1v2' (this is a custom indicator, I do not have the source code). I replaced it instead of Fast and Slow MA (the strategy worked on the intersections of these indicators, I replaced these MAs with Arrows from the new indicator). With Fast and Slow MA - I was able to export the Strategy without any problems. So, I do not think that the problem in classes. I any case, the Strategy uses:

          PHP Code:
          using System;
          using System.Globalization;
          using System.Collections.Generic;
          using System.ComponentModel;
          using System.ComponentModel.DataAnnotations;
          using System.Linq;
          using System.Text;
          using System.Threading.Tasks;
          using System.Windows;
          using System.Windows.Input;
          using System.Windows.Media;
          using System.Xml.Serialization;
          using NinjaTrader.Cbi;
          using NinjaTrader.Gui;
          using NinjaTrader.Gui.Chart;
          using NinjaTrader.Gui.SuperDom;
          using NinjaTrader.Gui.Tools;
          using NinjaTrader.Data;
          using NinjaTrader.NinjaScript;
          using NinjaTrader.Core.FloatingPoint;
          using NinjaTrader.NinjaScript.Indicators;
          using NinjaTrader.NinjaScript.DrawingTools;
          using System.IO;
          using System.Runtime.CompilerServices;
          using System.Diagnostics;
          using System.Windows.Controls;
          ​ 
          

          and

          PHP Code:
              public class Strategy3v0 : Strategy{
          
                  #region Class attributes
          
                  string            glPathLog;
                  int                 errAttempt    = 0;
          
                  SignalHandler     glSignalHandler;
          
                  BreakEven        glBreakEven;
                  TrailingStop      glTrailingStop;
          
                  EventEntry       glEventEntry;
                  EventExit         glEventExit;
          
                  Order             glOrderTakeProfit_1;
                  Order             glOrderTakeProfit_2;
                  Order             glOrderStopLoss_1;
                  Order             glOrderStopLoss_2;
          
                  bool[]            glNewBars;
                  DateTime[]        glNewBarTimes;
          
                  string            glOrderLongName_1            = "Long1";
                  string            glOrderShortName_1           = "Short1";
                  string            glOrderLongName_2            = "Long";
                  string            glOrderShortName_2           = "Short";
          
                  string            glOrderTakeProfitName_1    = "TakeProfit1";
                  string            glOrderTakeProfitName_2    = "TakeProfit";
                  string            glOrderStopLossName_1     = "StopLoss1";
                  string            glOrderStopLossName_2     = "StopLoss";
          
                  int                glBarsInProgressIndex;
                  int                glBuffer_Tick;
          
                  NordmanMainDivergencesIndicator1v2    glNordmanMainDivergencesIndicator1v2;
          
                  bool            glIsStarted;
          
          
          
                  #endregion​ 
          

          All custom classes are described in the strategy itself. Let me remind you that I can easily export the version of the strategy with standard indicators.
          Last edited by webus; 01-16-2023, 02:59 PM.

          Comment


            #6
            Hello webus,

            " Let me remind you that I can easily export the version of the strategy with standard indicators."

            This is a clear indication that something isn't included.

            What classes and indicators does NordmanMainDivergencesIndicator1v2 call. Please list all of them.

            If you comment out the line 'NordmanMainDivergencesIndicator1v2 glNordmanMainDivergencesIndicator1v2;' are you able to export?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hi NinjaTrader_ChelseaB​,

              Originally posted by NinjaTrader_ChelseaB View Post
              Hello webus,

              " Let me remind you that I can easily export the version of the strategy with standard indicators."

              This is a clear indication that something isn't included.

              What classes and indicators does NordmanMainDivergencesIndicator1v2 call. Please list all of them.

              If you comment out the line 'NordmanMainDivergencesIndicator1v2 glNordmanMainDivergencesIndicator1v2;' are you able to export?

              What classes and indicators does NordmanMainDivergencesIndicator1v2 call
              I do not know, I have no sourse code.

              Ok, I've made a simple example from scratch. Please take a look at the video below. Here is what I've done. I opened standard EMA indicator. Then saved it as 'EmaCustom'. Then exported it as a compiled assembly. Then I deleted the source code for the 'EmaCustom'. Then imported the 'EmaCustom'. Then created a simpliest Strategy (you will see it in the video) and added the 'EmaCustom'. I tried to export this new Strategy - the same error. This Strategy does not use any additional classes or indicators. Just the EMA. Can you please make these steps on your side?





              If you comment out the line 'NordmanMainDivergencesIndicator1v2 glNordmanMainDivergencesIndicator1v2;' are you able to export?
              Yes, I can. I think that the problem is in the NT8 platform. It cannot export a Strategy with an Indicator without source code. Please take a look:
              Click image for larger version  Name:	References2.jpg Views:	0 Size:	30.5 KB ID:	1231500
              Last edited by webus; 01-16-2023, 03:09 PM.

              Comment


                #8
                Hello webus,

                Your video does not show the full process and does not show what code is in EMACustom.


                "I think that the problem is in the NT8 platform. It cannot export a Strategy with an Indicator without source code."

                This would be incorrect.

                Below is a link to a video that demonstrates.
                https://drive.google.com/file/d/1Emw...usp=share_link

                If you follow the exact steps shown in the video using 8.0.27.1 the behavior is different than what is shown in the video I have provided you showing it works without issue?


                The issue you are having is the NordmanMainDivergencesIndicator1v2 is calling another script or class that also needs to be included with the export.

                If this is not your script, then you need to contact the author and inquire what classes and indicators are called by their script.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Hi NinjaTrader_ChelseaB​,​

                  Originally posted by NinjaTrader_ChelseaB View Post
                  Hello webus,

                  Your video does not show the full process and does not show what code is in EMACustom.


                  "I think that the problem is in the NT8 platform. It cannot export a Strategy with an Indicator without source code."

                  This would be incorrect.

                  Below is a link to a video that demonstrates.
                  https://drive.google.com/file/d/1Emw...usp=share_link

                  If you follow the exact steps shown in the video using 8.0.27.1 the behavior is different than what is shown in the video I have provided you showing it works without issue?


                  The issue you are having is the NordmanMainDivergencesIndicator1v2 is calling another script or class that also needs to be included with the export.

                  If this is not your script, then you need to contact the author and inquire what classes and indicators are called by their script.

                  Your video does not show the full process and does not show what code is in EMACustom.
                  Ok, you want me to make these steps again. Let's focus on the 'CustomEma' issue only. Please take a look. I did not share all indicators/strategies on my terminal, sorry. I think this is not crytical. Here is the video:



                  using 8.0.27.1
                  My NT8 version is '8.0.22.2 64-bit'.
                  upd: I have updated it on '8.0.27.1 64-bit' - the same error, but I do not want make the same video. Hope this is OK.


                  The issue you are having is the NordmanMainDivergencesIndicator1v2 is calling another script or class that also needs to be included with the export.
                  Sorry, but the 'CustomEma' does not have any classes or scripts - but it cannot be added also. Let's focus on the 'CustomEma' example from the video above.
                  Last edited by webus; 01-16-2023, 05:25 PM.

                  Comment


                    #10
                    Hello webus,

                    Parts of the video are blurred and hard to see what is going on.

                    That said, you may have something imported that may be causing an issue.

                    Try creating a clean environment folder to test.

                    Below is a link to a forum post with instructions.


                    If you are following the exact steps as shown in the video using 8.0.27.1 (and not 8.0.22.0) and the behavior is different than is what is shown in the video in a clean environment folder, I would like to schedule a call with you so that I may test these steps on your end.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Hi NinjaTrader_ChelseaB​,​

                      Originally posted by NinjaTrader_ChelseaB View Post
                      Hello webus,

                      Parts of the video are blurred and hard to see what is going on.

                      That said, you may have something imported that may be causing an issue.

                      Try creating a clean environment folder to test.

                      Below is a link to a forum post with instructions.
                      https://ninjatrader.com/support/foru...683#post783683

                      If you are following the exact steps as shown in the video using 8.0.27.1 (and not 8.0.22.0) and the behavior is different than is what is shown in the video in a clean environment folder, I would like to schedule a call with you so that I may test these steps on your end.
                      Thank you, we have a great progress. I've created a clean environment folder to test this - and now everything exports as it should (I don't even have to add the Reference - the platform itself adds it to the archive). I've made a video, but I think this video is not needed.
                      However, I see another error about accesing to the some file. Is this a critical error? Please take a look at the videos:

                      Error on 3:54:


                      Error on 0:27:


                      Thanks for your support. Have a nice day!

                      Comment


                        #12
                        Hello webus,

                        This error 'Unable to write AdditionalReferences.txt Access to the path 'C:\Users\Lenovo\Documents\NinjaTrader 8\tmp\8c2946c4-of3e-4d8cb0ed-1951be3b1151\AdditionalReferences.txt' is denied' is a problem. This is an issue with the Windows file system permissions.

                        The easiest way to resolve would be to give EVERYONE Full Control of the Documents\NinjaTrader 8\ folder.




                        As a tip, you can copy and paste error messages from the Log tab of the Control Center. Ctrl + c to copy, Ctrl + v to paste.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Hi NinjaTrader_ChelseaB​,​​

                          Originally posted by NinjaTrader_ChelseaB View Post
                          Hello webus,

                          This error 'Unable to write AdditionalReferences.txt Access to the path 'C:\Users\Lenovo\Documents\NinjaTrader 8\tmp\8c2946c4-of3e-4d8cb0ed-1951be3b1151\AdditionalReferences.txt' is denied' is a problem. This is an issue with the Windows file system permissions.

                          The easiest way to resolve would be to give EVERYONE Full Control of the Documents\NinjaTrader 8\ folder.

                          https://answers.microsoft.com/en-us/...1-4f9a6652dc90


                          As a tip, you can copy and paste error messages from the Log tab of the Control Center. Ctrl + c to copy, Ctrl + v to paste.


                          The easiest way to resolve would be to give EVERYONE Full Control of the Documents\NinjaTrader 8\ folder.

                          https://answers.microsoft.com/en-us/...1-4f9a6652dc90
                          Actually this does not help. However, the archive is seems OK. I can import it without any problems.


                          As a tip, you can copy and paste error messages from the Log tab of the Control Center. Ctrl + c to copy, Ctrl + v to paste
                          Yes, I know. I thought you want to see all steps.

                          Comment


                            #14
                            Hello webus,

                            To confirm, the permissions are changed for EVERYONE to have Full Control but the error is still occurring?

                            May I have a screenshot of the Documents\NinjaTrader 8\tmp\ folder permissions to confirm?
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              Hi NinjaTrader_ChelseaB​,​​​

                              Originally posted by NinjaTrader_ChelseaB View Post
                              Hello webus,

                              To confirm, the permissions are changed for EVERYONE to have Full Control but the error is still occurring?

                              May I have a screenshot of the Documents\NinjaTrader 8\tmp\ folder permissions to confirm?
                              Sorry for the Russian in the screenshots. "Все" means "Everyone". Please take a look:

                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Yesterday, 05:17 AM
                              0 responses
                              54 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              130 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              72 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              44 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              49 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X