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

DrawText error

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

    DrawText error

    am trying to modify a ninjascript file and keep getting the following error on compile:

    No overload for method 'DrawText' takes '10' arguments.

    if (signalIndex < 0 || Signals.Get(0) == signals[signalIndex]) {
    RemoveDrawObject(CurrentBar.ToString() + "Signal");
    Signals.Set(0);
    } else {
    if (signals[signalIndex] > 0 && myWoodies[0] < 120) {
    DrawText(CurrentBar.ToString() + "Signal_text", signals_text[signalIndex], 0, -180, Color.Blue, Signals_text, StringAlignment.Center, Color.Transparent,Color.Transparent,10);
    DrawArrowUp(CurrentBar.ToString() + "Signal", true, 0, -200, Color.LimeGreen);
    Alert(CurrentBar.ToString(), Priority.Medium, "Long:" + signals_text[signalIndex], alertAudioFile, alertTimeInterval*60, Color.Red, Color.White);
    Signals.Set(signals[signalIndex]);
    }
    else if (signals[signalIndex] < 0 && myWoodies[0] > -120) {
    DrawText(CurrentBar.ToString() + "Signal_text", signals_text[signalIndex], 0, -180, Color.Red,Signals_text,StringAlignment.Center,Colo r.Transparent,Color.Transparent,10);
    DrawArrowUp(CurrentBar.ToString() + "Signal", true, 0, -200, Color.Red);
    Alert(CurrentBar.ToString(), Priority.Medium, "Short:" + signals_text[signalIndex], alertAudioFile, alertTimeInterval*60, Color.Red, Color.White);
    Signals.Set(signals[signalIndex]);
    }
    }

    }


    have tried modify - obviously not up to the programming standards needed in ninjascript.

    any help appreciated.

    #2
    Hello,

    This means your parameters are messed up. Modify this line for your needs:
    DrawText(CurrentBar + "Signal_text",false, "test", 0, Close[0],0, Color.Blue, new Font("Arial", 10), StringAlignment.Center, Color.Transparent,Color.Transparent,10);

    Last edited by mountainclimber; 05-07-2010, 10:36 AM.

    Comment


      #3
      drawtest

      Mountainclimber
      tried this code - still get compile code that:

      no overload for method 'draw text' takes '10' arguments.

      f (signalIndex < 0 || Signals.Get(0) == signals[signalIndex]) {
      RemoveDrawObject(CurrentBar.ToString() + "Signal");
      Signals.Set(0);
      } else {
      if (signals[signalIndex] > 0 && myWoodies[0] < 120){
      DrawText(CurrentBar.ToString() + "Signal_text", true, signals_text[signalIndex], 0, 140, 0, Color.Blue,Signals_text,StringAlignment.Center,Col or.Transparent,Color.Transparent,0);
      DrawArrowUp(CurrentBar.ToString() + "Signal", true, 0, -200, Color.LimeGreen);
      Alert(CurrentBar.ToString(), Priority.Medium, "Long:" + signals_text[signalIndex], alertAudioFile, alertTimeInterval*60, Color.Red, Color.White);
      Signals.Set(signals[signalIndex]);
      }
      else if (signals[signalIndex] < 0 && myWoodies[0] > -120) {
      DrawText(CurrentBar.ToString() + "Signal_text", false, "test", 0, close[0], 0, Color.Blue,Signals_text,StringAlignment.Center,Col or.Transparent,Color.Transparent,10);
      DrawArrowUp(CurrentBar.ToString() + "Signal", true, 0, -180, Color.Red);
      Alert(CurrentBar.ToString(), Priority.Medium, "Short:" + signals_text[signalIndex], alertAudioFile, alertTimeInterval*60, Color.Red, Color.White);
      Signals.Set(signals[signalIndex]);
      }

      any thoughts appreciated.

      Comment


        #4
        Hello,

        Thank you for your note.

        We recieved the message and someone will follow up with you at the latest Monday.

        Thank you for your patience.

        Comment


          #5
          Make these changes one by one to determine the source of the issue:
          signals_text[signalIndex] --> "myTest"
          Signals_text --> new Font("Arial", 10),
          0); --> 10

          Comment


            #6
            nanook77, you likely miss the new PixelOffset paramter as well as this was added with the autoScale one to NT7's amended overload for DrawText -

            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by algospoke, Yesterday, 06:40 PM
            2 responses
            19 views
            0 likes
            Last Post algospoke  
            Started by ghoul, Today, 06:02 PM
            3 responses
            14 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            45 views
            0 likes
            Last Post jeronymite  
            Started by Barry Milan, Yesterday, 10:35 PM
            7 responses
            20 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by AttiM, 02-14-2024, 05:20 PM
            10 responses
            180 views
            0 likes
            Last Post jeronymite  
            Working...
            X