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

line not ploting

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

    line not ploting

    My problem is that if i use sMAP0 it will not work but if i use the sMAP1 it will but i cant change the value of it in the indicators when i add it to a chart. If someone could help me make the sMAP0 work i would greatly appreciate it.


    #region
    Variables
    // Wizard generated variables
    privateint eMAP = 14; // Default setting for EMAP
    privateint sMAP0 = 4; // Default setting for SMAP
    // User defined variables (add any user defined variables below)

    privatedouble EMAVal,SMAVal;
    privateint Displace = 0;
    privateint sMAP1 = 40;

    privatestring iAlert = "Alert1.wav";
    [Description(
    "")]
    [Category(
    "Parameters")]
    publicstring AlertString
    {
    get { return iAlert; }
    set { iAlert = value; }
    }

    #endregion

    #2
    Hello Cbart,

    Are there any error messages in the log tab of the control center?

    Can you share the whole snippet you're working with? We can take a look.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      no there isnt any errors, but here is the rest of it.
      protectedoverridevoid OnBarUpdate()
      {
      if (CurrentBar < Displace)
      return;

      EMAVal = EMA(Close, eMAP)[Displace];
      SMAVal = SMA(Close, sMAP1)[
      0];

      Plot0.Set(SMAVal);
      Plot1.Set(EMAVal);

      if(CurrentBar <= 6)
      return;

      sMA.Set(SMAVal);
      eMA.Set(EMAVal);

      if(sMA[1] > eMA[1] && sMA[0] < eMA[0])
      {
      DrawArrowDown(CurrentBar.ToString(),
      true, 0, High[0] + TickSize, Color.Red);
      PlaySound(
      @"C:\Program Files\NinjaTrader 6.5\sounds\Alert1.wav");
      }

      if(sMA[1] < eMA[1] && sMA[0] > eMA[0])
      {
      DrawArrowUp(CurrentBar.ToString(),
      true, 0, Low[0] - TickSize, Color.Blue);
      PlaySound(
      @"C:\Program Files\NinjaTrader 6.5\sounds\Alert1.wav");
      }

      Comment


        #4
        Hello cbart_1,

        If the issue is a line not plotting, please check the Initialize() method and the properties region for all the right structure. It may help to use the indicator wizard first to create your two plots and then view these sections.

        Start simple and then add complexity only when you've verified everything works as you expect.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          i got it this"
          PriceTypeSupported =
          true;" was set to false. Once i set it to true it worked

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by kujista, Today, 06:23 AM
          0 responses
          1 view
          0 likes
          Last Post kujista
          by kujista
           
          Started by traderqz, Yesterday, 04:32 PM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by f.saeidi, Today, 05:56 AM
          1 response
          4 views
          0 likes
          Last Post Jltarrau  
          Started by Jltarrau, Today, 05:57 AM
          0 responses
          4 views
          0 likes
          Last Post Jltarrau  
          Started by Stanfillirenfro, Yesterday, 09:19 AM
          7 responses
          52 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X