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

Strategy Builder not behaving as expected

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

    Strategy Builder not behaving as expected

    Hi,

    I have an issue using the strategy builder. Even when making very basic and simple strategies to test its behavior, the order management is not done as expected.

    For example, when a Stoch K line crosses above the D line, it should enter a long position. When the K line crosses below the D line it should enter a short position.

    I found that some orders are placed where cross overs did not occur.

    This is a very simple example. I have done other strategies with the builder that are far more complex, and as expected, it does not behave according to the conditions specified.

    So the question, are their knowledgeable persons (on NT8) out there who can do scripting for a fee or can you recommend honest people that can assist? I am done struggling to figure something out that does not respond as specified. I am well experienced with industrial PLC programming and understand control logic, but when I use the strategy builder on NT8 and I specify certain conditions (much as industrial control logic) I am not getting the desired results.

    Jacques

    #2
    Hello Jacques,

    Welcome to the NinjaTrader forums!

    To understand the behavior, such as an order being placed or not being placed, it is necessary to enable TraceOrders and add prints to the script.

    Print the time of the bar, print the value of the Stochastic K on the previous bar and the value of the Stochastic D on the previous bar and also print the value of the Stochastic K on the current bar and the value of the Stochastic D on the current bar.

    Below is a link to a forum post with videos that demonstrates.

    The prints will let you know on what bars the condition is evaluating as true, and TraceOrders lets you see where orders are being submitted and if orders are being ignored.

    Please provide the output from the NinjaScript Output window and I will be happy to assist with analyzing the output.


    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.

    I am not aware of any consultants that do programming or debugging work for free.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks.

      I want to compare the plot conditions (and not the values) of two different time frames and use that as a strategy condition. In other words, if the indicator plots bullish on both time frames, I want to use that as a condition to confirm trend direction as true.

      Attached is a screen shot of what the indicator looks like in the builder. I want to set the condition as true when my lower time frame (current closed bar) plots bullish and it equals the higher time frame (of the previous bar, as the current bar will still be open on the higher time frame) that must also plot bullish.

      I am only interested in the plot for now, and not the actual indicator value.

      Comment


        #4
        Hello Induna,

        It is possible to add a secondary time frame series on the Additional Data page of the Strategy Builder and then select this as the input series for an indicator.

        Below is a link to a video.


        The indicator value would be shorthand for the indicators most recent bar plot value.

        For example if I wanted to print the (plot) value of the sma.

        Print(SMA(14)[0]);
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi,

          i do have 2 time frame series defined. (see image). My question is what values/settings should I use to to only consider the plots, and not the actual ATR value?

          Just to show a simple example: I am painting an arrow every time the condition says its true. In this example (to prove a point) I have defined the condition that it should only show true when the current bar closes above the previous bar bullish plot. So in reality it should only paint the arrow when the ATR plots green dots, but for some reason it paints arrows on both green and red dots.

          See what I am getting at?



          Comment


            #6
            Hello Induna,

            I'm not sure that I am understanding.

            The indicator value used is from the PlotBullish plot selected in the Plot drop-down. This is being compared with the close of the 987 tick series..

            Is the PlotBullish an ATR from this indicator?

            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by TraderBCL, Today, 04:38 AM
            2 responses
            7 views
            0 likes
            Last Post TraderBCL  
            Started by martin70, 03-24-2023, 04:58 AM
            14 responses
            105 views
            0 likes
            Last Post martin70  
            Started by Radano, 06-10-2021, 01:40 AM
            19 responses
            606 views
            0 likes
            Last Post Radano
            by Radano
             
            Started by KenneGaray, Today, 03:48 AM
            0 responses
            4 views
            0 likes
            Last Post KenneGaray  
            Started by thanajo, 05-04-2021, 02:11 AM
            4 responses
            471 views
            0 likes
            Last Post tradingnasdaqprueba  
            Working...
            X