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!
See more
See less

Partner 728x90

Collapse

Unable to Amend Qty For Orders During BackTest

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

    Unable to Amend Qty For Orders During BackTest

    Hi,

    I'm having difficulties amending the entry quantity during my back test and I would like to know how to go about it. The following is my code Could you kindly advise?

    #region Variables
    privatedouble entryPrice = 1;
    privatedouble stopLoss = 1;
    privateint PositionQty = 300;

    protectedoverridevoid Initialize()
    {
    Add(CurrentDayOHL());
    SetStopLoss(
    "", CalculationMode.Price, StopLoss, true);
    ExitOnClose =
    true;
    ExitOnCloseSeconds =
    30;
    CalculateOnBarClose =
    true;
    }

    protectedoverridevoid OnBarUpdate()
    {

    if (Entry Conditions
    {

    EnterLongStopLimit(PositionQty,entryprice+0.02,entryprice,"SqueezeBuy" );


    }
    }

    Thanks

    #2
    sgtrader,

    What is your strategy set to for its "Set order quantity" properties?
    Adam P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by morrnel, Today, 06:07 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by thumper57, Yesterday, 04:30 PM
    6 responses
    20 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by sastrades, 05-10-2024, 09:59 AM
    3 responses
    54 views
    0 likes
    Last Post rc5781
    by rc5781
     
    Started by guyonabuffalo, Yesterday, 10:01 PM
    2 responses
    22 views
    0 likes
    Last Post guyonabuffalo  
    Started by reynoldsn, 05-10-2024, 07:04 PM
    5 responses
    27 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X