Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Account Value during Back Testing

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

    #16
    Hello pls2000,

    Thank you for your response.

    When assigning IOrder objects to your orders you will be calling these in the OnOrderUpdate() and OnExecution() methods, if they return null then that order is not calling the OnExecution. In that case you would check for any other IOrder objects.

    An effective check for null and that the IOrder object triggered the OnExecution() method is the following:
    Code:
    protected override void OnBarUpdate()
    {
        if (entryOrder == null && Close[0] > Open[0])
             entryOrder = EnterLong();
    }
     
    protected override void OnExecution(IExecution execution)
    {
        if (entryOrder != null && entryOrder == execution.Order)
             Print(execution.ToString());
    }
    -This was taken from the following link in our Help Guide: http://www.ninjatrader.com/support/h...nexecution.htm

    Please let me know if I may be of further assistance.

    Comment


      #17
      Can you recommend how it would be done to create your own internal cacluation

      Comment


        #18
        Hello fiddy,

        Thank you for your post.

        Create your own variable for the Account Size, then use the performance values available in NinjaScript to update this variable. You would then use your own calculation logic to set the quantity based on the current value of the variable.

        For information on Performance in NinjaScript please visit the following link: http://www.ninjatrader.com/support/h...erformance.htm

        Please let me know if I may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        67 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        36 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
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X