Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy disables automatically

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

    Strategy disables automatically

    Hi,
    I'm using a very simple strategy I created that marks bars which close below an EMA.
    The issue I'm having is that the strategy frequently becomes disabled after I've made a trade using Chart Trader, resulting in my having to manually re-enable it many times per session.
    Here is the strategy and a related clip from my log.
    Any suggestions would be appreciated.
    Thanks.



    Click image for larger version

Name:	log.png
Views:	368
Size:	9.4 KB
ID:	1285068



    #2
    Hello manraygun,

    That would be expected if you close a position using the chart trader. In general its not supported to manually trade the same instrument that your strategy is running on. The strategy is intended to work in your place instead of you manually trading. For a strategy to not be disabled and also have the ability to manually trade you would need to make a more advanced strategy that adds custom buttons to the chart so you can have the strategy submit orders rather than the chart trader.

    Comment


      #3
      Thanks. Is there an easy way to turn this into an indicator? Set 1 is just the opposite and a different barbrush color.

      Click image for larger version

Name:	strat.png
Views:	364
Size:	23.8 KB
ID:	1285277

      Comment


        #4
        Hello manraygun,

        You can use the View Code features to view the C# code that was generated. Indicators are manually coded so you would need to reference the code for your condition and then put that code in the same locations in the indicators code. You can create new indicators using the NinjaScript editor.

        Comment


          #5
          Thanks. Would the NinjaScript Wizard be useful here?

          Comment


            #6
            Hello manraygun,

            The new indicator wizard can be used to generate the basics for an indicator like plots or user inputs but that is mainly just for creating a new indicator, it does not have a condition builder like the strategy builder. Once you make a new indicator you can use the strategy builder to make conditions and then click view code so you can see what code was made and then replicate that in the indicator.

            Comment


              #7
              I see. Thank you.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              72 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              44 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              25 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              30 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              61 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X