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

CandleStick does not print on chart

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

    CandleStick does not print on chart

    Hi

    I tried a very simple strategy like

    Code:
    protected override void OnStateChange(){
                if (State == State.SetDefaults){
                    Description = @"Enter the description for your new custom Strategy here.";
                    Name = "MyCustomStrategy";
                    TrendStrength = 4;
                }
                else if (State == State.DataLoaded){
                    _candlestickPattern = CandlestickPattern(ChartPattern.BullishEngulfing, TrendStrength);   
                    AddChartIndicator(_candlestickPattern);
                    _sma = SMA(10);
                    AddChartIndicator(_sma);
                }
            }
    
            
    
            protected override void OnBarUpdate(){
                Print(_candlestickPattern.PatternFound[0]);
    but the CandleStick indicator does not print anything unless i remove the link in the OnBarUpdate method

    I must be missing something too basic or what?

    #2
    Hello tolisss,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    I am seeing the Prints in the Output window in my testing. I have attached my strategy to this response. Can you test this on your end and advise if you see the Prints?

    I look forward to your response.
    Attached Files

    Comment


      #3
      yeah the output window gets the messages however the _candleStick indicator was suppose to draw a text and nothing is drawn on the chart

      Comment


        #4
        when my strategy looks like
        Code:
               TrendStrength = 4;
                    }
                    else if (State == State.DataLoaded){
                        _bullishCandlestickPattern = CandlestickPattern(ChartPattern.BullishEngulfing, TrendStrength);   
                        AddChartIndicator(_bullishCandlestickPattern);
                    }
                }
        
                protected override void OnBarUpdate(){
                    if (CurrentBar<BarsRequiredToTrade)
                        return;
                    EnterLongOnFound();
                }
        
                private void EnterLongOnFound(){
                    if ((int) _bullishCandlestickPattern.PatternFound[0] == 1){
                        EnterLongLimit(999, GetCurrentAsk());
                    }
                }
        the chart is
        Click image for larger version

Name:	Charts1.png
Views:	1
Size:	14.3 KB
ID:	882074

        but when I comment the EnterLongOnFound call the CandleStick draws as expected to draw also before.

        Click image for larger version

Name:	charts2.png
Views:	1
Size:	7.8 KB
ID:	882075

        Comment


          #5
          Hello tolisss,

          Thank you for your response.

          I see what you are detailing. I will investigate further and follow up with you here.

          Comment


            #6
            Hello tolisss,

            Thank you for your patience.

            If you comment out the call to the PatternFound Series the strategy will show the indicator on the chart. Although, I have had tests where the indicator was still showing the text on the chart when calling this print. Commenting out this call will always allow the indicator to draw it's text on the chart.
            Code:
            Print(_candlestickPattern.PatternFound[0]);
            I am looking into this further on my end.

            Comment


              #7
              Hello tolisss,

              Thank you for your patience.

              I have confirmed our latest internal build is not experiencing this when printing the exposed Series (PatternFound).

              Comment


                #8
                Hi

                Good news but it that release public? does the app autoupdate or do I have to uninstall first

                Comment


                  #9
                  Hello tolisss,

                  Thank you for your response.

                  You can update the platform when the latest release is made available (currently this is only in the internal build). No need to uninstall the platform and there is no auto-update.

                  Please let me know if you have any questions.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Gerik, Today, 09:40 AM
                  2 responses
                  6 views
                  0 likes
                  Last Post Gerik
                  by Gerik
                   
                  Started by RookieTrader, Today, 09:37 AM
                  2 responses
                  10 views
                  0 likes
                  Last Post RookieTrader  
                  Started by alifarahani, Today, 09:40 AM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by KennyK, 05-29-2017, 02:02 AM
                  3 responses
                  1,285 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Started by AttiM, 02-14-2024, 05:20 PM
                  11 responses
                  186 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Working...
                  X