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

Question about changing an indicator

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

    Question about changing an indicator

    Hello all,

    I have an indicator that I would like to have the portion, listed below, not activate but not deleted from the indicator either. In DOS you could REM but not sure what to do in this programming language,

    Thanks.

    #region Message Banners

    if (isUpThrustBar[0])
    {
    bannerstring = "Up-thrusts are designed to catch stops and " + "\n" +
    "to mislead as many traders as possible.They are normally " + "\n" +
    "seen after there has been weakness in the background. The market" + "\n" +
    "makers know that the market is weak, so the price is marked up to " + "\n" +
    "catch stops, encourage traders to go long in a weak market,AND panic" + "\n" +
    "traders that are already Short into covering their very good position.";

    textColor = Color.Yellow;
    bannerColor = Color.Red;
    }
    if (upThrustConditionThree)
    {
    bannerstring = "This upthrust bar is at high volume." + "\n" +
    "This is a sure sign of weakness. One may even seriously" + "\n" +
    "consider ending the Longs AND be ready to reverse";

    textColor = Color.Yellow;
    bannerColor = Color.Blue;
    }
    if (isUpThrustBar[0] || upThrustConditionThree)
    {
    bannerstring = "Also note that A wide spread down-bar" + "\n" +
    "that appears immediately after any up-thrust, tends to " + "\n" +
    "confirm the weakness (the market makers are locking in traders" + "\n" +
    "into poor positions). With the appearance of an upthrust you " + "\n" +
    "should certainly be paying attention to your trade AND your stops." + "\n" +
    "On many upthrusts you will find that the market will 'test' " + "\n" +
    "almost immediately.";

    textColor = Color.Yellow;
    bannerColor = Color.Red;
    }
    if (upThrustConditionOne)
    {
    bannerstring = "A wide spread down bar following a Upthrust Bar." + "\n" +
    "This confirms weakness. The Smart Money is locking in Traders " + "\n" +
    "into poor positions";

    textColor = Color.White;
    bannerColor = Color.Lime;
    }
    if (upThrustConditionTwo)
    {
    bannerstring = "Also here the volume is high(Above Average)." + "\n" +
    "This is a sure sign of weakness. The Smart Money is locking in" + "\n" +
    "Traders into poor positions";

    textColor = Color.White;
    bannerColor = Color.Lime;
    }
    if (strenghtInDownTrend)
    {
    bannerstring = "Strength Bar. The stock has been in a down Trend." + "\n" +
    "An upbar with higher Volume closing near the High is a sign of " + "\n" +
    "strength returning. The downtrend is likely to reverse soon.";

    textColor = Color.Red;
    bannerColor = Color.Lime;
    }
    if (strenghtInDownTrend1)
    {
    bannerstring = "Here the volume is very much above average." + "\n" +
    "This makes this indication more stronger.";

    textColor = Color.Black;
    bannerColor = Color.Yellow;
    }
    if (isStrengthConfirmationBar)
    {
    bannerstring = "The previous bar saw strength coming back. " + "\n" +
    "This upbar confirms strength.";

    textColor = Color.Blue;
    bannerColor = Color.Lime;
    }
    if (isPseudoUpThrustBar[0])
    {
    bannerstring = "A pseudo Upthrust. This normally appears after an" + "\n" +
    "Up Bar with above average volume. This looks like an upthrust bar " + "\n" +
    "closing down near the Low. But the Volume is normally Lower than average." + "\n" +
    "this is a sign of weakness.If the Volume is High then weakness increases." + "\n" +
    "Smart Money is trying to trap the retailers into bad position.";

    textColor = Color.White;
    bannerColor = Color.Lime;
    }
    if (pseudoUpThrustConfirmation)
    {
    bannerstring = "A downbar after a pseudo Upthrust Confirms weakness. " + "\n" +
    "If the volume is above average the weakness is increased.";

    textColor = Color.Yellow;
    bannerColor = Color.Blue;
    }
    if (supplyTestInUpTrendBar)
    {
    bannerstring = "The previous bar was a successful Test of supply." + "\n" +
    "The current bar is a upbar with higher volume. This confirms strength";

    textColor = Color.Yellow;
    bannerColor = Color.Blue;
    }
    if (distributionBar)
    {
    bannerstring = "A wide range, high volume bar in a up trend " + "\n" +
    "closing down is an indication the Distribution is in progress. " + "\n" +
    "The smart money is Selling the stock to the late Comers rushing to " + "\n" +
    "Buy the stock NOT to be Left Out Of a Bullish move.";

    textColor = Color.Blue;
    bannerColor = Color.Yellow;
    }
    if (successfulSupplyTestBar)
    {
    bannerstring = "The previous bar was a successful Test of" + "\n" +
    "supply. The current bar is a upbar with higher volume. This " + "\n" +
    "confirms strength";

    textColor = Color.Blue;
    bannerColor = Color.Aqua;
    }
    if (weaknessBar)
    {
    bannerstring = "The stock has been moving up on high volume." + "\n" +
    "The current bar is a Downbar with high volume. Indicates weakness" + "\n" +
    "and probably end of the up move";

    textColor = Color.Yellow;
    bannerColor = Color.Blue;
    }
    if (effortUpMoveBar[0])
    {
    bannerstring = "Effort to Rise bar. This normally " + "\n" +
    "found in the beginning of a Markup Phase and is bullish" + "\n" +
    "sign.These may be found at the top of an Upmove as the " + "\n" +
    "Smart money makes a last effort to move the price to the maximum";

    textColor = Color.Blue;
    bannerColor = Color.Aquamarine;
    }
    if (effortDownMove)
    {
    bannerstring = "Effort to Fall bar. This normally" + "\n" +
    "found in the beginning of a Markdown phase.";

    textColor = Color.Red;
    bannerColor = Color.Blue;
    }
    if (noSupplyBar)
    {
    bannerstring = "No Supply. A no supply bar indicates" + "\n" +
    "supply has been removed and the Smart money can markup the" + "\n" +
    "price. It is better to wait for confirmation";

    textColor = Color.White;
    bannerColor = Color.Lime;
    }

    if (stopVolBar)
    {
    bannerstring = "Stopping Volume. This will be " + "\n" +
    "an downbar during a bearish period closing towards" + "\n" +
    "the Top accompanied by High volume. A stopping Volume " + "\n" +
    "normally indicates that smart money is absorbing the " + "\n" +
    "supply which is a Indication that they are Bullishon " + "\n" +
    "the MArket.Hence we Can expect a reversal in the down trend.";

    textColor = Color.Blue;
    bannerColor = Color.Turquoise;
    }

    if (noDemandBar)
    {
    bannerstring = "No Demand Brief Description: " + "\n" +
    "Any up bar which closes in the middle OR Low," + "\n" +
    "especially if the Volume has fallen off, is a " + "\n" +
    "potential sign of weakness. Things to Look Out for: " + "\n" +
    "if the market is still strong, you will normally see " + "\n" +
    "signs of strength in the next few bars, which will most " + "\n" +
    "probably show itself as a: Down bar with a narrow spread," + "\n" +
    " closing in the middle OR High. * Down bar on Low Volume.";

    textColor = Color.White;
    bannerColor = Color.Yellow;
    }

    if (banners)
    DrawTextFixed("Banner2", bannerstring, TextPosition.BottomLeft, Color.Black, font, Color.White, Color.White, 10);
    else
    RemoveDrawObject("Banner2");

    #endregion

    #2
    use // for single line , and use /* for multi line */

    exa 1 single line:

    // if x then z

    exa2 multi line:
    /*
    if x
    then z
    */

    Comment


      #3
      Hello Segwin,

      Thank you for writing in. In addition to what sledge said, using the /* and */ for a multi line comment will not always automatically comment out all the code within. This is because certain characters used in programming can cause the comment to end prematurely. I recommend always checking to be sure that 100% of the code in between your /* and */ is the green comment color.

      In the example code you provided however, just the single /* and */ will comment it out correctly:
      Code:
      /*#region Message Banners
      
      if (isUpThrustBar[0])
      {
      bannerstring = "Up-thrusts are designed to catch stops and " + "\n" +
      "to mislead as many traders as possible.They are normally " + "\n" +
      "seen after there has been weakness in the background. The market" + "\n" +
      "makers know that the market is weak, so the price is marked up to " + "\n" +
      "catch stops, encourage traders to go long in a weak market,AND panic" + "\n" +
      "traders that are already Short into covering their very good position.";
      
      textColor = Color.Yellow;
      bannerColor = Color.Red;
      }
      if (upThrustConditionThree)
      {
      bannerstring = "This upthrust bar is at high volume." + "\n" +
      "This is a sure sign of weakness. One may even seriously" + "\n" +
      "consider ending the Longs AND be ready to reverse";
      
      textColor = Color.Yellow;
      bannerColor = Color.Blue;
      }
      if (isUpThrustBar[0] || upThrustConditionThree)
      {
      bannerstring = "Also note that A wide spread down-bar" + "\n" +
      "that appears immediately after any up-thrust, tends to " + "\n" +
      "confirm the weakness (the market makers are locking in traders" + "\n" +
      "into poor positions). With the appearance of an upthrust you " + "\n" +
      "should certainly be paying attention to your trade AND your stops." + "\n" +
      "On many upthrusts you will find that the market will 'test' " + "\n" +
      "almost immediately.";
      
      textColor = Color.Yellow;
      bannerColor = Color.Red;
      }
      if (upThrustConditionOne)
      {
      bannerstring = "A wide spread down bar following a Upthrust Bar." + "\n" +
      "This confirms weakness. The Smart Money is locking in Traders " + "\n" +
      "into poor positions";
      
      textColor = Color.White;
      bannerColor = Color.Lime;
      }
      if (upThrustConditionTwo)
      {
      bannerstring = "Also here the volume is high(Above Average)." + "\n" +
      "This is a sure sign of weakness. The Smart Money is locking in" + "\n" +
      "Traders into poor positions";
      
      textColor = Color.White;
      bannerColor = Color.Lime;
      }
      if (strenghtInDownTrend)
      {
      bannerstring = "Strength Bar. The stock has been in a down Trend." + "\n" +
      "An upbar with higher Volume closing near the High is a sign of " + "\n" +
      "strength returning. The downtrend is likely to reverse soon.";
      
      textColor = Color.Red;
      bannerColor = Color.Lime;
      }
      if (strenghtInDownTrend1)
      {
      bannerstring = "Here the volume is very much above average." + "\n" +
      "This makes this indication more stronger.";
      
      textColor = Color.Black;
      bannerColor = Color.Yellow;
      }
      if (isStrengthConfirmationBar)
      {
      bannerstring = "The previous bar saw strength coming back. " + "\n" +
      "This upbar confirms strength.";
      
      textColor = Color.Blue;
      bannerColor = Color.Lime;
      }
      if (isPseudoUpThrustBar[0])
      {
      bannerstring = "A pseudo Upthrust. This normally appears after an" + "\n" +
      "Up Bar with above average volume. This looks like an upthrust bar " + "\n" +
      "closing down near the Low. But the Volume is normally Lower than average." + "\n" +
      "this is a sign of weakness.If the Volume is High then weakness increases." + "\n" +
      "Smart Money is trying to trap the retailers into bad position.";
      
      textColor = Color.White;
      bannerColor = Color.Lime;
      }
      if (pseudoUpThrustConfirmation)
      {
      bannerstring = "A downbar after a pseudo Upthrust Confirms weakness. " + "\n" +
      "If the volume is above average the weakness is increased.";
      
      textColor = Color.Yellow;
      bannerColor = Color.Blue;
      }
      if (supplyTestInUpTrendBar)
      {
      bannerstring = "The previous bar was a successful Test of supply." + "\n" +
      "The current bar is a upbar with higher volume. This confirms strength";
      
      textColor = Color.Yellow;
      bannerColor = Color.Blue;
      }
      if (distributionBar)
      {
      bannerstring = "A wide range, high volume bar in a up trend " + "\n" +
      "closing down is an indication the Distribution is in progress. " + "\n" +
      "The smart money is Selling the stock to the late Comers rushing to " + "\n" +
      "Buy the stock NOT to be Left Out Of a Bullish move.";
      
      textColor = Color.Blue;
      bannerColor = Color.Yellow;
      }
      if (successfulSupplyTestBar)
      {
      bannerstring = "The previous bar was a successful Test of" + "\n" +
      "supply. The current bar is a upbar with higher volume. This " + "\n" +
      "confirms strength";
      
      textColor = Color.Blue;
      bannerColor = Color.Aqua;
      }
      if (weaknessBar)
      {
      bannerstring = "The stock has been moving up on high volume." + "\n" +
      "The current bar is a Downbar with high volume. Indicates weakness" + "\n" +
      "and probably end of the up move";
      
      textColor = Color.Yellow;
      bannerColor = Color.Blue;
      }
      if (effortUpMoveBar[0])
      {
      bannerstring = "Effort to Rise bar. This normally " + "\n" +
      "found in the beginning of a Markup Phase and is bullish" + "\n" +
      "sign.These may be found at the top of an Upmove as the " + "\n" +
      "Smart money makes a last effort to move the price to the maximum";
      
      textColor = Color.Blue;
      bannerColor = Color.Aquamarine;
      }
      if (effortDownMove)
      {
      bannerstring = "Effort to Fall bar. This normally" + "\n" +
      "found in the beginning of a Markdown phase.";
      
      textColor = Color.Red;
      bannerColor = Color.Blue;
      }
      if (noSupplyBar)
      {
      bannerstring = "No Supply. A no supply bar indicates" + "\n" +
      "supply has been removed and the Smart money can markup the" + "\n" +
      "price. It is better to wait for confirmation";
      
      textColor = Color.White;
      bannerColor = Color.Lime;
      }
      
      if (stopVolBar)
      {
      bannerstring = "Stopping Volume. This will be " + "\n" +
      "an downbar during a bearish period closing towards" + "\n" +
      "the Top accompanied by High volume. A stopping Volume " + "\n" +
      "normally indicates that smart money is absorbing the " + "\n" +
      "supply which is a Indication that they are Bullishon " + "\n" +
      "the MArket.Hence we Can expect a reversal in the down trend.";
      
      textColor = Color.Blue;
      bannerColor = Color.Turquoise;
      }
      
      if (noDemandBar)
      {
      bannerstring = "No Demand Brief Description: " + "\n" +
      "Any up bar which closes in the middle OR Low," + "\n" +
      "especially if the Volume has fallen off, is a " + "\n" +
      "potential sign of weakness. Things to Look Out for: " + "\n" +
      "if the market is still strong, you will normally see " + "\n" +
      "signs of strength in the next few bars, which will most " + "\n" +
      "probably show itself as a: Down bar with a narrow spread," + "\n" +
      " closing in the middle OR High. * Down bar on Low Volume.";
      
      textColor = Color.White;
      bannerColor = Color.Yellow;
      }
      
      if (banners)
      DrawTextFixed("Banner2", bannerstring, TextPosition.BottomLeft, Color.Black, font, Color.White, Color.White, 10);
      else
      RemoveDrawObject("Banner2");
      
      #endregion*/
      Please let me know if you have any questions.
      Michael M.NinjaTrader Quality Assurance

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      6 responses
      28 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by gbourque, Today, 06:39 AM
      2 responses
      14 views
      0 likes
      Last Post gbourque  
      Started by rexsole, Today, 08:39 AM
      0 responses
      6 views
      0 likes
      Last Post rexsole
      by rexsole
       
      Started by trilliantrader, Yesterday, 03:01 PM
      3 responses
      31 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by Brevo, Today, 01:45 AM
      1 response
      14 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X