• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

VSA Indicator - Beta

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

    #16
    Originally posted by Mindset View Post
    Do you mean TickSize?
    Perhaps you could show an example?
    Yes, that's what I ment. In case your final calculation can be used as integer values then it is an easy desicion. If you have to covert double-> int first and at the end int -> double then it depends (conversion takes time, integer calculation saves time).

    At the example below I calculated rectangles based on prices to be plotted with the indicator's Plot()-method. Therefore the coversion made sense.

    Regards
    Ralph

    Code:
    public TimePeriod(DateTime StartDate, double PriceHigh, double PriceLow)
    {
     int dim;
     startDate = StartDate;
     baseInst = dataInst.BaseInstance;
     boxSize = baseInst.BoxSize;
     priceHigh = (int)(PriceHigh / TickSize) / boxSize * boxSize;
     priceLow = (int)(PriceLow / TickSize) / boxSize * boxSize;
     dim = (priceHigh - priceLow) / boxSize + 1;
     priceRects = new Rectangle[dim];
     borderPen = new Pen(Color.Black);
     fillBrush = new SolidBrush(Color.Empty);
    }
    

    Comment


      #17
      Cast

      V Interesting thank you.
      Is this a form of casting then - taking a double and making it an int as such?
      I wonder which is quicker?

      Code:
      Compare( Low[0],Close[0])
      or

      Code:
      iclose = Close[0] / TickSize;
      iLow = Low[0] / tickSize;
      if (iclose = ilow).....

      Comment


        #18
        Yes, dividing with TickSize eliminates the fraction of the value, but it is still a double, the C#-compiler is very strict so you need to cast it explicitely.

        I don't know which one is quicker. It is 3 operations against a single compare ...
        But you could try to find it out. You could measure cpu-time in ticks (100 nano seconds) and calculate the difference.

        int time1 = DateTime.Now.Ticks;
        compare()...
        int diff = DateTime.Now.Ticks - time1;

        Regards
        Ralph

        Comment


          #19
          May be it will be worth attention.
          Be careful with "casting"
          double doublevalue = 1.99999999;
          int castValue = (int)doublevalue;

          castValue gonna be 1 (not 2)
          Last edited by roonius; 01-08-2009, 08:33 PM.

          Comment


            #20
            Thanks roonius good point. I never had a problem with that but was wondering whether it could or should. Maybe it works because I convert before I apply the first operation to the price value. Just my personal experience.

            For NT there is a function Round2TickSize() available, perhaps that's the save way.

            Regards
            Ralph

            Comment


              #21
              Originally posted by scjohn View Post
              Here is my take on the same AmiBroker code.

              Notes: I coded a Wilder MA indicator that is included in the attached file. I also used LinRegSlopSFX to find the slope. Also, I used a slightly different color scheme to paint the bars with.
              Hi scjohn

              I am interested in this indicator ...do you have any information as to exactly what the different symbols signify. I had a look at the blogsite but it is not specific. And if I wanted to change the color code how would I? Do I need to go directly into the script?

              thanks for your work!

              Comment


                #22
                There is really no documentation of what the various symbols mean. One would have to study the code and make an educated guess.

                If you want to change colors then you have to into the code and make the change.

                Comment


                  #23
                  The first thing I did was change the candles since I hate solid candles and prefer to see the trend style. Also the light colors were hard to see unless the chart background was VERY dark. Even these colors work best on a darker gray background.

                  Code:
                  #region Candle Definition                    
                          
                              if ( TLS > 0.00 && TLM > 0.00 && TLL > 0.00)
                                  {  
                      CandleOutlineColor = Color.LimeGreen; 
                      if(Open[0]<Close[0] && ChartControl.ChartStyleType == ChartStyleType.CandleStick ) {
                                          BarColor  = Color.Transparent;
                                      } else{
                                          BarColor  = Color.Lime;
                                      }                                
                                  } 
                              
                              else if ( TLS > 0.00 && TLM > 0.00 && TLL < 0.00)
                                  {  
                      CandleOutlineColor = Color.DarkGreen; 
                      if(Open[0]<Close[0] && ChartControl.ChartStyleType == ChartStyleType.CandleStick ) {
                                          BarColor  = Color.Transparent;
                                      } else{
                                          BarColor  = Color.Green;
                                      }                                
                                  } 
                              else if ( TLS > 0.00 && TLM < 0.00 && TLL < 0.00)
                                  {  
                      CandleOutlineColor = Color.LightGreen; 
                      if(Open[0]<Close[0] && ChartControl.ChartStyleType == ChartStyleType.CandleStick ) {
                                          BarColor  = Color.Transparent;
                                      } else{
                                          BarColor  = Color.PaleGreen;
                                      }                                
                                  } 
                              else if ( TLS< 0.00 && TLM < 0.00 && TLL < 0.00)
                                  {  
                      CandleOutlineColor = Color.Red; 
                      if(Open[0]<Close[0] && ChartControl.ChartStyleType == ChartStyleType.CandleStick ) {
                                          BarColor  = Color.Transparent;
                                      } else{
                                          BarColor  = Color.OrangeRed;
                                      }                                
                                  } 
                              else if ( TLS< 0.00 && TLM > 0.00 && TLL > 0.00)
                                  {  
                      CandleOutlineColor = Color.LightGreen; 
                      if(Open[0]<Close[0] && ChartControl.ChartStyleType == ChartStyleType.CandleStick ) {
                                          BarColor  = Color.Transparent;
                                      } else{
                                          BarColor  = Color.PaleGreen;
                                      }                                
                                  } 
                              else if ( TLS< 0.00 && TLM < 0.00 && TLL > 0.00)
                                  {  
                      CandleOutlineColor = Color.HotPink; 
                      if(Open[0]<Close[0] && ChartControl.ChartStyleType == ChartStyleType.CandleStick ) {
                                          BarColor  = Color.Transparent;
                                      } else{
                                          BarColor  = Color.Pink;
                                      }                                
                                  } 
                              else {  
                      CandleOutlineColor = Color.Gold; 
                      if(Open[0]<Close[0] && ChartControl.ChartStyleType == ChartStyleType.CandleStick ) {
                                          BarColor  = Color.Transparent;
                                      } else{
                                          BarColor  = Color.Yellow;
                                      }
                              }
                  eDanny
                  NinjaTrader Ecosystem Vendor - Integrity Traders

                  Comment


                    #24
                    how to import formula

                    could you put it in zip format for direct importing in NT. I dont know how to import formula you rightet

                    Thanks in advance

                    Comment


                      #25
                      My version of the indicator has been edited for my own use. You will have to just copy and paste the code to your indicator. Then re-compile.
                      eDanny
                      NinjaTrader Ecosystem Vendor - Integrity Traders

                      Comment


                        #26
                        nice work, thx for sharing

                        can you give me a discription of how to read/use the indicator?

                        thx

                        Comment


                          #27
                          Turn some features off

                          Hi,

                          Is there an easy way to turn some features off. Like bar coloring?

                          Also is there a key to what the shapes indicate

                          regards,

                          Blair

                          Comment


                            #28
                            Originally posted by blaircampbell View Post
                            Hi,

                            Is there an easy way to turn some features off. Like bar coloring?

                            Also is there a key to what the shapes indicate

                            regards,

                            Blair
                            Blair,


                            The original author has a blog in the following http - www.vpanalysis.blogspot.com/, in order to turn off any feature just comment the associated part with " // " prior to any statement and your ready to rock.

                            Best Regards,

                            Comment


                              #29
                              Thanks

                              Thanks PrTester for your great work!!
                              Thanks to the others for their contribuition!

                              I have a question/suggestion, PrTester it's possible to change the banner and put them as background, so it does not cover the candle chart, and maybe even the possibility to change their position between the different chart corner?


                              Thanks.

                              Lubo.

                              Comment


                                #30
                                Originally posted by LuboLabo View Post
                                Thanks PrTester for your great work!!
                                Thanks to the others for their contribuition!

                                I have a question/suggestion, PrTester it's possible to change the banner and put them as background, so it does not cover the candle chart, and maybe even the possibility to change their position between the different chart corner?


                                Thanks.

                                Lubo.
                                Hey LuboLabo, only need to change the DrawtextFixed colors for Transparent and your done, also you can change the position in the same line.

                                Regards

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by StefanJ, Today, 04:11 AM
                                2 responses
                                7 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Started by fxSol, 03-17-2019, 04:17 AM
                                3 responses
                                22 views
                                0 likes
                                Last Post NinjaTrader_ChristopherD  
                                Started by MarthaClines, Yesterday, 08:06 PM
                                1 response
                                9 views
                                0 likes
                                Last Post NinjaTrader_ChrisL  
                                Started by Trader_Kim, Yesterday, 03:41 PM
                                1 response
                                12 views
                                0 likes
                                Last Post NinjaTrader_ChristopherD  
                                Started by MarthaClines, Yesterday, 06:23 PM
                                1 response
                                3 views
                                0 likes
                                Last Post NinjaTrader_PaulH  
                                Working...
                                X