stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Baluda Indicators
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=629
Page 57 of 81
Author:  phil_trade [ Tue Jun 25, 2013 7:37 am ]
Post subject:  Re: Baluda Indicators

Hello Paul

I'm using CSS 1.06. When I compare CSS $ from GPF (with sunday candle) with HotForex or FxPro (without sunday candle) result are differents (ex. -0.11 instead of -0.32 ).

In GetSlope code, you skip well sunday candle, but not in calcTmaTrue() and CalcPrevTrue(). You use a loop for the last 20 bars...where there are Sunday candles ! I have try with 24 (4 sunday in 20 days) and the result is OK.

Could you have a look and confirm.

Philippe

Code: Select all

double GetSlope(string symbol, int tf, int shift)
{
   double dblTma, dblPrev;
   int shiftWithoutSunday = shift;
   if ( addSundayToMonday && sundayCandlesDetected && tf == PERIOD_D1 )
   {
      if ( TimeDayOfWeek( iTime( symbol, PERIOD_D1, shift ) ) == 0  ) shiftWithoutSunday++;
   }   
   double atr = iATR(symbol, tf, 100, shiftWithoutSunday + 10) / 10;
   double gadblSlope = 0.0;
   if ( atr != 0 )
   {
      if ( ignoreFuture )
      {
         dblTma = calcTmaTrue( symbol, tf, shiftWithoutSunday );
         dblPrev = calcPrevTrue( symbol, tf, shiftWithoutSunday );
      }
      else
      {   
         dblTma = calcTma( symbol, tf, shiftWithoutSunday );
         dblPrev = calcTma( symbol, tf, shiftWithoutSunday + 1 );
      }   
      gadblSlope = ( dblTma - dblPrev ) / atr;
   }
   
   return ( gadblSlope );

}

Code: Select all

//+------------------------------------------------------------------+
//| calcTmaTrue()                                                    |
//+------------------------------------------------------------------+
double calcTmaTrue( string symbol, int tf, int inx )
{
   return ( iMA( symbol, tf, 21, 0, MODE_LWMA, PRICE_CLOSE, inx ) );
}

//+------------------------------------------------------------------+
//| calcPrevTrue()                                                   |
//+------------------------------------------------------------------+
double calcPrevTrue( string symbol, int tf, int inx )
{
   double dblSum  = iClose( symbol, tf, inx + 1 ) * 21;
   double dblSumw = 21;
   int jnx, knx;
   
   dblSum  += iClose( symbol, tf, inx ) * 20;
   dblSumw += 20;
         
   for ( jnx = 1, knx = 20; jnx <= 20; jnx++, knx-- )
   {
      dblSum  += iClose( symbol, tf, inx + 1 + jnx ) * knx;
      dblSumw += knx;
   }
   
   return ( dblSum / dblSumw );
}
Author:  aSushiRoll [ Thu Jun 27, 2013 4:07 am ]
Post subject:  Re: Baluda Indicators

Hi guys, especially Baluda, I have 2 questions about the indicators:

1)This has been bugging me quite some time and I think I know the answer but I want to ask you guys anyway.

The name of currencySLOPEstrenght is a bit confusing to me. From what I've read the lines show the strength of the currencies relative to eachother. If one is on top of the other it means it's stronger and so the pair will go up. Right?

But the name currencySLOPEstrenght implies the lines indicate the slope of the strength of the currencies. So that would be the derrivative from the strengthline of the currencies right. Is this the case?

I hope you understand what I'm asking. I'll try to rephrase it:
Do the lines of currencyslopestrength show the strength of the currencies (higher means stronger) or does the height of a line indicate that it has a higher slope? Which would mean that if a line is higher then it's getting stronger, without saying anything of the relative strength in regards to other currencies.

The reason I'm asking ofcourse is to interpret the indicator in the best way possible and besides if the lines only indicate relative strength (higher is stronger) then I want to code an indicator with the derivative of this line, so the slope. In which case currencySLOPEstrength is a bit of a confusing name to me ;)

2) A question about CSSDIFF. The way I read the description about this indicator is it shows the amount of deviation the currencylines have in regards to eachother. So the wider the lines are apart in currencyslopestrength the bigger the amplitude of CSSDIFF? If this is the case then there must be something wrong with the way it works on my screen. I'll post a screenshot for reference.
As you can clearly see even when currencyslopestrength lines are crossing (difference=0) there's still amplitude in CSSDIFF.

I thought then maybe CSSDIFF indicates convergence/divergence of the currencyslopestrength lines but that does not seem to be the case as well (I want to code an indicator like this as well!!)



Hope you guys can help me.

Sushi
Author:  Jemook [ Thu Jun 27, 2013 5:01 am ]
Post subject:  Re: Baluda Indicators

There was some nice debate here on this topic sushi:

http://www.stevehopwoodforex.com/phpBB3 ... f=37&t=724

Hope that helps.

J
Author:  Ingot54 [ Thu Jun 27, 2013 11:20 am ]
Post subject:  Re: Baluda Indicators

Just a quick question:

I have been able to change the CSS indicator to display both 1H and 4H CSS ... easy enough ... by going into the Input panel.
Multi CSS.JPG
Has anyone produced a CSS indicator that displays 1H ... 4H ... Daily in the one panel?

I would like to be able to view all three TF simultaneously.

I use a GP demo to display the CSS on a third monitor, so there are no CPU issues.

Thanks in advance. Building a "three-storey" CSS is beyond me.
Author:  Baluda [ Thu Jun 27, 2013 11:40 am ]
Post subject:  Re: Baluda Indicators

phil_trade wrote:In GetSlope code, you skip well sunday candle, but not in calcTmaTrue() and CalcPrevTrue(). You use a loop for the last 20 bars...where there are Sunday candles ! I have try with 24 (4 sunday in 20 days) and the result is OK.
Philippe,

Sunday bars are skipped in GetSlope, I do not have to skip them again in the functions that are called from GetSlope. They are called with 'shiftWithoutSunday'.

Paul
Author:  phil_trade [ Thu Jun 27, 2013 12:29 pm ]
Post subject:  Re: Baluda Indicators

Baluda wrote:
phil_trade wrote:In GetSlope code, you skip well sunday candle, but not in calcTmaTrue() and CalcPrevTrue(). You use a loop for the last 20 bars...where there are Sunday candles ! I have try with 24 (4 sunday in 20 days) and the result is OK.
Philippe,

Sunday bars are skipped in GetSlope, I do not have to skip them again in the functions that are called from GetSlope. They are called with 'shiftWithoutSunday'.

Paul
Sorry Paul but I disagree.

You do use them in calcTmaTrue() and CalcPrevTrue() when using iClose() function without skipping sunday !
Author:  aSushiRoll [ Fri Jun 28, 2013 4:24 am ]
Post subject:  Re: Baluda Indicators

Jemook wrote:There was some nice debate here on this topic sushi:

http://www.stevehopwoodforex.com/phpBB3 ... f=37&t=724

Hope that helps.

J
That topic is about TMA, I'm not up to date about what TMA is, but I was talking about CSS :) Are they related?
Author:  Frenetic [ Mon Jul 01, 2013 9:26 am ]
Post subject:  Re: Baluda Indicators

Frenetic wrote:Alright, to prevent Empty4 recognising a week as
Mon,Tue,Wed,Thu,Fri,Sun instead of Sun,Mon,Tue,Wed,Thu,Fri

Replace this:

Code: Select all

// Weekly
lastLow = iLow ( NULL, PERIOD_W1, pivotBar + 1 );
lastHigh = iHigh ( NULL, PERIOD_W1, pivotBar + 1 );
lastClose = iClose ( NULL, PERIOD_W1, pivotBar + 1 );
With this:

Code: Select all

// Weekly
int day = TimeDayOfWeek(iTime(Symbol(),PERIOD_D1,0)); //current day
if ( sundayCandlesDetected ){
   lastHigh = iHigh ( Symbol(), PERIOD_D1, iHighest ( Symbol(), PERIOD_D1, MODE_HIGH, 6, day+1+pivotBar*6 ) );
   lastLow = iLow ( Symbol(), PERIOD_D1, iLowest ( Symbol(), PERIOD_D1, MODE_LOW, 6, day+1+pivotBar*6 ) );
   lastClose = iClose ( Symbol(), PERIOD_D1, day+1+pivotBar*6 );
}
else {
   lastHigh = iHigh ( Symbol(), PERIOD_D1, iHighest ( Symbol(), PERIOD_D1, MODE_HIGH, 5, day+pivotBar*5 ) );
   lastLow = iLow ( Symbol(), PERIOD_D1, iLowest ( Symbol(), PERIOD_D1, MODE_LOW, 5, day+pivotBar*5 ) );
   lastClose = iClose ( Symbol(), PERIOD_D1, day+pivotBar*5 );
}
Broker with no sunday bars showing Weekly Pivot correctly as expected:
2013-02-19 week pivot _ 3 _ no sunday bars.gif
Broker with sunday bars showing Weekly Pivot correctly now:
2013-02-19 week pivot _ 4 _ sunday bars _ corrected.gif
Instead of pre-edit:
2013-02-19 week pivot _ 5 _ sunday bars _ uncorrected.gif
Just discovered the limitation of counting day bars instead of week bars, if the week has 4 days, e.g. missing Christmas/New Year's Day, the count will be off and screwing up the week pivot calculation for the entire period before the week with missing day.

Detecting 25th Dec, 1st Jan, as weekdays is a colossal pain in the ass as you have to look for a day that is not there, i.e. look for 24th Dec or 26th Dec, 31st Dec or 2nd Jan, as adjacent to a potential weekday for 25th Dec, 1st Jan, respectively. Plus having to accommodate Sunday bar detection.

There's gotta be a better way to make Empty4 to recognise a week as [Sun-Mon-Tue-Wed-Thu-Fri] instead of [Mon-Tue-Wed-Thu-Fri-Sun] for weekhigh, weeklow, weekclose calculations.
Author:  Jemook [ Thu Jul 04, 2013 2:11 pm ]
Post subject:  Re: Baluda Indicators

I'd like some info from anyone that's been using the GlobalMarketTrend that Baluda coded. What exactly is it calculating? If it's trending up does this mean the CSS values of a lot of the pairs are high?

Baludes, I'd love to see a MTF version of this which is scaled so if I choose D1 and drop it down to H1 it steps up or down. Don't worry about it if it's not easy to code. I'm going to spend some time with this indi and see what I can find.
Author:  Baluda [ Mon Jul 08, 2013 7:56 am ]
Post subject:  Re: Baluda Indicators

Jemook wrote:I'd like some info from anyone that's been using the GlobalMarketTrend that Baluda coded. What exactly is it calculating? If it's trending up does this mean the CSS values of a lot of the pairs are high?
Jem,

The GlobalMarketTrend is the sum of all CSS' squared. I believe it could have use to determine the, let's say, global market trend.

Will provide a MTF version in due time.

Cheers,

Paul
All times are UTC Page 57 of 81