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

Using strategy to shade background

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

    Using strategy to shade background

    I have used Condition Builder to construct a strategy with user-defined inputs, so that I can adjust the profit targets manually based on market conditions. Therefore, I would like to use DM/ADX to shade the chart using a back brush so I can visually see whether I should be swinging long, scalping long, swinging short, or scalping short. I think I have enough knowledge to do this through strategy builder.

    Strategies are intended to have buy and sell signals for automated trading, and indicators cannot draw on the chart. This strategy will be combined with another strategy which will provide the automation. Before I spend a lot of time constructing this back brush strategy, will there be a problem with using it for the drawing only, and use another strategy for the entries and exits? Or would it be better to just add tabs to the automated strategy in order color the chart backgrounds? If I use tabs, I will have to exit the whole strategy to change my user-defined inputs. If another strategy executes a signal, will that deactivate the back brush strategy?

    Thanks

    #2
    Hello Bionian,

    Thanks for your post.

    The statement, "...and indicators cannot draw on the chart." is not correct. The purpose of an indicator is to indicate something (typically on the chart) and indicators have full access to drawing tools/methods.

    "Before I spend a lot of time constructing this back brush strategy, will there be a problem with using it for the drawing only, and use another strategy for the entries and exits?" Yes, you can certainly create 2 separate strategies and run them at the same time on the same instrument. As one will only provide drawing there would be no issue with orders. I would suggest creating one just for testing the drawing logic/ability anyway and later if you want to add it to your order placing strategy, you will have already tested the functionality.

    "Or would it be better to just add tabs to the automated strategy in order color the chart backgrounds?" In the end, I would suggest this way as it will be less overhead and management on your part. Again you could create it separately as a means to test out and once functionality is confirmed and your strategy is performing as desired you could then combine them into one with confidence.

    "If I use tabs, I will have to exit the whole strategy to change my user-defined inputs" I am not sure which tabs you are referring to. Do you mean chart tabs or strategy tabs? Yes, you would have to disable the strategy to change a user defined input (assuming you are meaning to change the input value).

    "If another strategy executes a signal, will that deactivate the back brush strategy?" If the backbrush strategy does not place orders, I would not expect any interference from another strategy.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      [QUOTE=NinjaTrader_PaulH;n1080448]Hello Bionian,

      Thanks for your post.

      The statement, "...and indicators cannot draw on the chart is not correct. The purpose of an indicator is to indicate something (typically on the chart) and indicators have full access to drawing tools/methods."
      Sorry- I was thinking about alerts.


      "Yes, you would have to disable the strategy to change a user defined input (assuming you are meaning to change the input value)."
      Yes, I am using user defined inputs to define the amount of a pull back before I get an entry signal. The only way I know to do this would be to remove and reapply the strategy. That's a definite advantage to avoid making the back brush strategy part of the order execution strategy. If I change parameters, my chart coloring doesn't have to close while making the change.

      "If the backbrush strategy does not place orders, I would not expect any interference from another strategy."
      So what is the practical difference between using an indicator and using a strategy with no entry or exit criteria?

      Thanks for the reply.

      Comment


        #4
        Hello Bionian,

        Thanks for your reply.

        " I was thinking about alerts.", Thanks for clarifying, I agree, alerts do not draw on the chart.

        "So what is the practical difference between using an indicator and using a strategy with no entry or exit criteria?" With a strategy you have to enable it to run, so when you shutdown the next time you restart you would have to remember to re- enable the strategy that draws An indicator only needs to be applied once and it stays active and is automatically runs when you re-connect.

        If you want to make an indicator, what I would suggest is to create your indicating strategy and once you have it tested and verified, I would create an indicator using the Ninjascript indicator wizard where you enter your inputs and outputs and the wizard creates the overall structure, then you should be able to "view code" of the strategy builder and basically copy and paste the contents of the OnbarUpdate() to the indicator, compile the indicator and then you should be good to go. Here is a link to the Ninjascript wizard (which is not the builder) https://ninjatrader.com/support/help...?ns_wizard.htm This would actually be a good way for you to get into Ninjascript because the startegy will do what you need for now and meanwhile you can build the same functionality in the indicator using the same coding as provided by the strategy builder.
        Paul H.NinjaTrader 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