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 CarlTrading, 03-31-2026, 09:41 PM
                  1 response
                  64 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by CarlTrading, 04-01-2026, 02:41 AM
                  0 responses
                  35 views
                  0 likes
                  Last Post CarlTrading  
                  Started by CaptainJack, 03-31-2026, 11:44 PM
                  0 responses
                  59 views
                  1 like
                  Last Post CaptainJack  
                  Started by CarlTrading, 03-30-2026, 11:51 AM
                  0 responses
                  62 views
                  0 likes
                  Last Post CarlTrading  
                  Started by CarlTrading, 03-30-2026, 11:48 AM
                  0 responses
                  51 views
                  0 likes
                  Last Post CarlTrading  
                  Working...
                  X