Announcement

Collapse
No announcement yet.

Please Help ! ! !

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

  • Please Help ! ! !

    How is it possible to code Simple Moving Avergae of exprassion? Is it possible to do it in 1 line like this Average((Close+Low+High-Open)/2)or should I make ALL calculation by hand? Please help ASAP.

  • #2
    Also I need the following indicators:
    1) BollingerBands of (high - open)
    2) BollingerBands of abs(open - close)
    3) BollingerBands of (close - low)
    How is it possible to code? Could you provide me these formulas.
    Thank you very much.

    Comment


    • #3
      Re: Reply to post 'Re: Reply to post 'Please Help ! ! ! ''

      Hi Alex,

      if it possible tell me the code or tell me how to code it with formula
      wizard this simple formula:

      BollingerBands of (high - open)

      without re-writing the Bollinger Bands code !!!

      WAITING FOR YOUR REPLY ! ! !

      my best,

      Young

      ffec> Hello youngtrader,

      ffec> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ffec>

      Comment


      • #4
        Re: Reply to post 'Re: Reply to post 'Re: Reply to post 'Please Help ! ! ! '''

        Young
        Contrary to my original reply, which I pulled the moment I realized you were
        using a different input, you cannot do that with Formula Wizard
        Alex

        Comment


        • #5
          Hi Young,

          I think it's impossible to write BollingerBands(high - open) as is, but try to use the following solution to not modify BollingerBands formula every time:

          Code:
          function main(Length) {
          	if(Length == null)
          		Length = 20;
          	BBArray = new Array();
          	for(i = 0; i < Length; i++)
          		BBArray[i] = (high(-i) - open(-i));
          
          	return new Array(BollingerBands(BBArray,Length,Top=1),BollingerBands(BBArray,Length,Bot=-1));
          }
          
          function BollingerBands(Array,Length,Type) {
          	if(Length == null)
          		Length = 55;
          	if(StdDev == null)
          		StdDev = .5;
          		
          	var i;
          	var vSum = 0.0;
          	var BBTop;
          	var BBBot;
          	var SumSqr = 0;
          	var StdDev = 0;
          
          	for(i = 0; i < Length; i++)
                  	vSum += Array[i];
          
          	if(Length != 0)
          		for(i = 0; i < Length; i++)
          			SumSqr += (Array[i] - vSum / Length) * (Array[i] - vSum / Length);
          	StdDev = Math.sqrt(SumSqr / Length);
          	BBTop = vSum / Length + StdDev * StdDev;
          	BBBot = vSum / Length - StdDev * StdDev;
          	if(Type == 1)
          		return BBTop;
          	else if(Type == -1)
          		return BBBot;
          }

          If you have any further questions or require additional assistance please let me know.

          Regards,
          Andy

          Comment


          • #6
            thanks for all who replied !!

            seems like it works !!

            Young

            Comment

            Working...
            X