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 argusthome, 03-08-2026, 10:06 AM
        0 responses
        24 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        20 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        14 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        10 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        41 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X