Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy code that waits for the entry setup

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

    Strategy code that waits for the entry setup

    Hello. I am fairly new to using ninja trader strategy builder and have no coding knowledge and I would be grateful for your input... mainly I have 2 problems that prevent me translating my strategy to the strategy builder.

    1) my main entry signal is when the price cross over EMA. pretty simple and i can use that in the builder. However, i have a bunch of other indicators that I need to agree with the direction of the cross to enter the trade. i usually wait for 4 tick bars after the cross for the indicators to line up, if they don't, i abort the trade even if they do align after the 4rth bar.

    How can I translate that to the strategy builder???

    2) one of the indicators when I try to apply its logic in the strategy builder, I get this error "no overload for the method "SMI" takes 18 arguments" could someone help me understand it and how can i correct. I have uploaded the code of the indicator SMI5. The way I add it in the strategy builder, if plot value "SMI" is greater than plot value "SMIEMA", as I understand that is the indicator logic for changing the background color
    Attached Files

    #2
    Hello mghorab,

    Thank you for your post.

    If you want to count the number of bars since an event occurred (like 4 bars since a crossover), you will need to use custom series. Two custom series are needed, one to hold the current bar at the time of the cross and another to hold the current bar number (you cannot perform math using CurrentBar[] so a series is needed for this).

    We have an existing sample script (ExampleBarCounter) which demonstrates this concept.




    This error looks like it was built for NinjaTrader 7, not NinjaTrader 8 (it is using Initialize() which is a NT7 function). I would not expect this indicator to work in NinjaTrader 8. Regardless, this error means you are not supplying the correct amount of arguments when calling the indicator. I would recommend reaching out to the developer if it is not working properly within the Strategy Builder. Our support team is unable to assist with scripts from a third party.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    50 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    127 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    69 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X