• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can fast approach of Draw.Region() be used when indicator in hosted in strategy?

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

    Can fast approach of Draw.Region() be used when indicator in hosted in strategy?

    Hello.

    To speedup Draw.Region() I using approach like this:
    PHP Code:
    public class iHostedDrawRegion Indicator
    {
        
    Region My_Region;
        
        protected 
    override void OnStateChange()
        {
            if (
    State == State.SetDefaults)
            {
                
    Name "iHostedDrawRegion";
            }
            else if( 
    State == State.DataLoaded )
            {
                
    My_Region Draw.Region(this"Region"00LowHigh,   nullWmBrushes.LimeGreen70 );    
            }
        }

        protected 
    override void OnBarUpdate()
        {
            
    My_Region.EndAnchor.DrawnOnBar CurrentBar;
        } 
    It works very fast and stable in indicator.

    But, if to add indicator in strategy - it not draw.


    Is there any way to let it work?
    Attached Files
    Last edited by fx.practic; 08-07-2017, 01:45 PM.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    I found out, that My_Region.OnRender() not triggered from host strategy.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    Comment


      #3
      Hello fx.practic,

      Thank you for your post.

      I am testing the strategy and indicator here. I will look into this further and follow up when I have more details. If you have any questions in the meantime please let me know.
      Patrick H.NinjaTrader Customer Service

      Comment


        #4
        Thank You, Patrick, very march!

        It is great tool, and I just can't work without it.
        Recreation of region on each bar is very-very slow.

        I made naive try to call Region.OnRender() from Strategy.OnRender(), but got exception RenderTarget == null
        fx.practic
        NinjaTrader Ecosystem Vendor - fx.practic

        Comment


          #5
          Hello, Patrick
          Just want to say I still need it very much.
          Hope You can find way.
          I made some crazy experiments - but no one give good results.
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment


            #6
            Hello fx.practic,

            Thank you for your patience.

            Drawing in the OnStateChange function is not supported. Seeing this work in the indicator itself is not expected, but there is no expected behavior.

            Even if you would expect this to be more efficient it is unfortunately not supported.

            Please let me know if you have any questions.
            Patrick H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by saltminer, Today, 05:19 PM
            0 responses
            3 views
            0 likes
            Last Post saltminer  
            Started by martyn73, Today, 04:18 PM
            0 responses
            2 views
            0 likes
            Last Post martyn73  
            Started by aprendiz, Today, 03:42 PM
            0 responses
            2 views
            0 likes
            Last Post aprendiz  
            Started by 1001111, Today, 09:10 AM
            1 response
            18 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Started by usero86, Today, 06:02 AM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Working...
            X