Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trix

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

    #16
    Do I need some sort of "IF" statement to draw the text?

    Comment


      #17
      Just put it in the same place you have the DrawArrowUp(). Remember to add the { } for your current if-statement.

      Code:
      if (....)
      {
          DrawArrowUp(...);
          DrawText(...);
      }
      Josh P.NinjaTrader Customer Service

      Comment


        #18
        I did this but it does not work:

        // if (CrossBelow(TRIX(period, signalPeriod).Default, 0,1))
        if (CrossBelow(TRIX(period, signalPeriod).Default, TRIX(period, signalPeriod).Signal, 1))
        DrawArrowDown(
        "MyArrowDown"+CurrentBar, 0, High[0]+5* TickSize, Color.Red);
        DrawText(
        "MyText", "Sell", 0, High[0] + 6 * TickSize, Color.Red);
        // if (CrossAbove(TRIX(period, signalPeriod).Default, 0,1))
        if (CrossAbove(TRIX(period, signalPeriod).Default, TRIX(period, signalPeriod).Signal, 1))
        DrawArrowUp(
        "MyArrowUp"+CurrentBar, 0, Low[0] -5* TickSize, Color.Green);
        DrawText(
        "MyText", "Buy", 0, Low[0] - 6 * TickSize, Color.Green);

        Comment


          #19
          Originally posted by rtj4201 View Post
          I did this but it does not work:
          you missed what support just told you, put in the bracket for each of the IF statement since you want to do 2 things following the IF statement.

          here we go, this one is crossing zero line signal

          // if (CrossBelow(TRIX(period, signalPeriod).Default, TRIX(period, signalPeriod).Signal, 1))
          if (CrossBelow(TRIX(period, signalPeriod).Default, 0,1))
          {
          DrawArrowDown("MyArrowDown"+CurrentBar, 0, High[0]+2* TickSize, Color.Red);
          DrawText("MyText"+CurrentBar, "Sell", 0, High[0] + 6 * TickSize, Color.Red);
          }

          // if (CrossAbove(TRIX(period, signalPeriod).Default, TRIX(period, signalPeriod).Signal, 1))
          if (CrossAbove(TRIX(period, signalPeriod).Default, 0,1))
          {
          DrawArrowUp("MyArrowUp"+CurrentBar, 0, Low[0] -2* TickSize, Color.Orange);
          DrawText("MyText"+CurrentBar, "Buy", 0, Low[0] - 6 * TickSize, Color.Green);
          }
          Attached Files
          Last edited by nkhoi; 03-15-2009, 02:04 PM.

          Comment


            #20
            The DrawArrows are small and similar to some of my other indicators and are hard to see.

            Is there any way to modify the DrawArrow parameters to make the arrow larger?

            Comment


              #21
              rtj4201,

              Unfortunately not.
              Josh P.NinjaTrader Customer Service

              Comment


                #22
                Originally posted by rtj4201 View Post
                The DrawArrows are small and similar to some of my other indicators and are hard to see.

                Is there any way to modify the DrawArrow parameters to make the arrow larger?
                See http://www.ninjatrader-support2.com/...ead.php?t=4759

                Comment


                  #23
                  replace your code with this, remember I am using cross zero line not cross signal line;

                  // if (CrossBelow(TRIX(period, signalPeriod).Default, TRIX(period, signalPeriod).Signal, 1))
                  if (CrossBelow(TRIX(period, signalPeriod).Default, 0,1))
                  {
                  DrawArrowDown("MyArrowDown"+CurrentBar, 0, High[0]+2* TickSize, Color.Red);
                  // DrawDot(CurrentBar.ToString(), 0, High[1] + 10 * TickSize, Color.Red);
                  // DrawText("MyText"+CurrentBar, true,"Sell", 0, High[0] + 12 * TickSize, Color.Red,pfont);
                  DrawText("V"+CurrentBar, true, sellText, 0, High[0] + 8 * TickSize, yPixels, sColor, pfont,
                  StringAlignment.Center, Color.Empty, Color.Empty, 10) ;
                  }

                  //if (CrossAbove(TRIX(period, signalPeriod).Default, TRIX(period, signalPeriod).Signal, 1))
                  if (CrossAbove(TRIX(period, signalPeriod).Default, 0,1))
                  {
                  DrawArrowUp("MyArrowUp"+CurrentBar, 0, Low[0] -2* TickSize, Color.Orange);
                  // DrawText("MyText"+CurrentBar, "Buy", 0, Low[0] - 6 * TickSize, Color.Green);
                  DrawText("V"+CurrentBar, true, buyText, 0, Low[0] - 10 * TickSize, yPixels, bColor, pfont,
                  StringAlignment.Center, Color.Empty, Color.Empty, 10) ;

                  }

                  also go to REGIONAL variables section, add this:

                  private string sellText = @"SELL";
                  private Font pfont = new Font("Arial", 12, FontStyle.Bold, GraphicsUnit.Point);
                  private Color sColor = Color.Red;
                  private string buyText = @"BUY";
                  private Color bColor = Color.Green;
                  private int yPixels = 10;
                  Attached Files
                  Last edited by nkhoi; 03-16-2009, 09:12 AM.

                  Comment


                    #24
                    I want the arrow plot when the ma line crosses the signal line. How would that be coded?

                    Comment


                      #25
                      Please take a look at nkhoi's code. It already does that.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #26
                        Originally posted by rtj4201 View Post
                        I want the arrow plot when the ma line crosses the signal line. How would that be coded?
                        my code;
                        // if (CrossBelow(TRIX(period, signalPeriod).Default, TRIX(period, signalPeriod).Signal, 1))
                        if (CrossBelow(TRIX(period, signalPeriod).Default, 0,1))

                        .....


                        change to:

                        if (CrossBelow(TRIX(period, signalPeriod).Default, TRIX(period, signalPeriod).Signal, 1))
                        // if (CrossBelow(TRIX(period, signalPeriod).Default, 0,1))

                        .....



                        see the different?

                        Comment


                          #27
                          I would like to plot the TRIX indicator on the price chart; however, it is normalized and the scale would not work. Is it possible to just show the
                          actual triple average and the signal line on the price chart without the normalized part?

                          Comment


                            #28
                            rtj4201,

                            Unfortunately not. Such a change would require you to recode the indicator.
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #29
                              So how would i recode the indicator?

                              Comment


                                #30
                                rtj4201,

                                You need to open up the indicator code and go through it yourself. Unfortunately we just do not have enough bandwidth to step you through actually modifying it.

                                As a hint, trying to change something like this requires you to completely change up the math logic.
                                Josh P.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by hdge4u, Yesterday, 09:09 PM
                                0 responses
                                19 views
                                0 likes
                                Last Post hdge4u
                                by hdge4u
                                 
                                Started by hdge4u, Yesterday, 09:02 PM
                                0 responses
                                10 views
                                0 likes
                                Last Post hdge4u
                                by hdge4u
                                 
                                Started by stormcloudseven, Yesterday, 08:41 PM
                                1 response
                                11 views
                                0 likes
                                Last Post DavidTrades  
                                Started by GussJ, Yesterday, 01:24 PM
                                0 responses
                                25 views
                                0 likes
                                Last Post GussJ
                                by GussJ
                                 
                                Started by frslvr, Yesterday, 12:40 PM
                                0 responses
                                16 views
                                0 likes
                                Last Post frslvr
                                by frslvr
                                 
                                Working...
                                X