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

Indicator implemented as strategy

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

    Indicator implemented as strategy

    Hi!
    I am experiencing an issue with the strategy. I have created an indicator which fulfills my expectations. I want to use this indicator in the strategy, but in backtest I am not having the number of trades I should normally have as shown with the indicator. To be clear: the indicator pups up arrows when conditions are met. The same code in the strategy does not return the same number of trades as specify by the indicator. This number from the strategy is always less than what the indicator shows.
    I am even allocated the value of 10 to the part of the strategy entitled “Entries per direction” and also selected “All entries” for “Entry handling”
    Am I missing something?
    Best regrads

    #2
    Hello Stanfillirenfro,

    Looking at the number of trades the code produces is not really going to help determine whats wrong only that someting happened different. To address this question you would need to make a comparison of how your logic executes in each use case. You can add prints into the script to help with that, then run the indicator and run the strategy and compare prints. Depending on what you see is happening differently could help guide your debugging further.

    Indicators and strategies are not exactly equal so there can be some items that make differences in how they operate. Using prints or other means to debug the logic will help to identify if you are running into one of those items.

    You can also use TraceOrders from the strategy to see if any orders are being ignored, that would be another reason why it may be less.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by RDTrader16, Today, 10:19 PM
    0 responses
    5 views
    0 likes
    Last Post RDTrader16  
    Started by gemify, 03-08-2023, 08:02 AM
    9 responses
    148 views
    0 likes
    Last Post culpepper  
    Started by elirion, Today, 10:03 PM
    0 responses
    1 view
    0 likes
    Last Post elirion
    by elirion
     
    Started by RaddiFX, Today, 09:55 PM
    0 responses
    9 views
    0 likes
    Last Post RaddiFX
    by RaddiFX
     
    Started by Trader146, 03-29-2024, 01:22 PM
    4 responses
    27 views
    0 likes
    Last Post Trader146  
    Working...
    X