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 GLFX005, Today, 03:23 AM
    0 responses
    1 view
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    11 views
    0 likes
    Last Post XXtrader  
    Started by Waxavi, Today, 02:10 AM
    0 responses
    6 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by TradeForge, Today, 02:09 AM
    0 responses
    14 views
    0 likes
    Last Post TradeForge  
    Started by Waxavi, Today, 02:00 AM
    0 responses
    3 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Working...
    X