Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Force Liberal Programmatically

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

    Force Liberal Programmatically

    Is there a way to force a strategy to have a default of Liberal, instead of Default, for Historical Order Processing?

    I tried

    HistoricalOrderProcessing = Liberal;

    but that didn't compile.

    #2
    Hello coolmoss,
    Please try the below code to do it.

    Code:
    this.FillType = new LiberalFillType();
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hi Joydeep,

      This works, except that when I go to export the strategy as a compiled assembly, I get an error compiling export assembly. Error states that 'LiberalFillType' could not be found. Do I need to add a using directive or an assembly reference?

      Thanks much for your help,

      Bob

      Comment


        #4
        Hello Bob,
        Yes, you need to add the FillType while exporting the strategy.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          I don't see the LiberalFillType.cs anywhere in the list in the Export Ninjascript wizard window. Can you please further explain exactly what I need to do. I've never needed to reference an outside .cs file before.

          Many thanks.

          Comment


            #6
            Hello Bob,
            To assist you further may I know,
            • Are you trying to using the LiberalFilltype of any custom filltype
            • Are you exporting the strategy as a source or as an assembly.


            I look forward to assisting you further.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              I don't understand your first question. My desire is to place a line of code in Initialize() that will force the Historical Order Processing to use the Liberal fill type instead of the Default fill type. I'm NOT attempting to create a new fill type.

              I'm exporting as an assembly.

              Thanks.

              Comment


                #8
                Hello Bob,
                Thanks for the clarification.

                Please follow the below steps to export the code:
                • Close NinjaTrader
                • Please copy paste the @LiberalFillType.cs file from the folder ~|Documents\NinjaTrader 7\bin\Custom\Type\ to the folder ~\Documents\NinjaTrader 7\bin\Custom\Indicator\
                • Start NinjaTrader.
                • In Control Center menu bar goto File>Utilities>Export NinjaScrpt..
                • In the Export NinjaScript dialog select your strategy and the @LiberalFillType (choose export objects as System Indicators) and export it.


                Please move the @LiberalFillType to the Type folder once you are done.
                JoydeepNinjaTrader Customer Service

                Comment


                  #9
                  Thanks very much Joydeep!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  648 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  369 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  108 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  573 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  575 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X