PDA

View Full Version : Indicator on indicator


maxpi
08-01-2007, 03:23 PM
If I write an indicator that calls another indicator as part of it's main function, and the called indicator defaults to calculating at end of bar, will the called indicator always calculate at bar's end or will it, if I set my calling indicator to update intrabar, update intrabar?

Gumphrie
08-01-2007, 03:46 PM
It will update intrabar, but as the indicator it is calling only updates at end of bar you will always get the same value returned until the next bar closes. You could be calling lots of indicators from your indicator, so you don't want to change the default behaviour of other indicators, but if you do, you should probably create another indicator.

maxpi
08-01-2007, 04:20 PM
Thanks. One could write psudo indicators that were really to be used as functions, think I will.

maxpi
08-01-2007, 04:35 PM
does the called indicator have to have a Plot0 in it in order to return a value?

Gumphrie
08-01-2007, 04:48 PM
No, you could just declare a DataSeries.

The important bit is in the properties. If it was a Plot it would look like :-


public DataSeries myLine
{
get Values[0];
}

But if it was your own DataSeries it could look like :-


public DataSeries myLine
{
get myDataSeries;
}