Dennis,
For the record I have also encountered this problem.
Essentially, SBR can only be used to 'increase' the number of bars 'on the
fly'. Lets pretend you have a conditional statement at the end of your code...
if (Param1)
{
SetBarsRequired(200,0)
}else{
SetBarsRequired(1000,0)
}
If you
Dennis -
I was just making sure about you understanding of the SetBarsRequired()
placement. I agree with most of your summary, but let's put the minor
points aside and turn to your issue. FWIW, I'd like to have full
control over bar requirements also. Actually - even more than you want,
but
Try this solution, array style:
m = MACD();
fb = Status(FirstVisibleBar);
lb = Status(LastVisibleBar);
r = lb - fb;
minimum = LastValue( LLV( m, r ) );
maximum = LastValue( HHV( m, r ) );
Plot( m, MACD, colorRed, styleOwnScale, minimum, maximum );
Plot(0, , colorBlack, styleOwnScale, minimum,
Dennis, all -
If you hadn't asked if you weren't missing something, I probably
wouldn't post. This is similar to something that Herman and I discussed
a week or so back. See those posts, but, IMO, your conclusion about
looping is incorrect, and hey, I'll do anything to avoid yard work.
You
Bruce,
Thanks for the comments. I load 200,000 bars in my program, then use
SetBarsRequired( DesiredHistory, 0 ) to speed up operation to just the
bars I need at the time for my purposes. When running realtime
trading, I set my history to 5,000 to 10,000 bars to get all my
calculations
Yes Tony,
This is close to what I was referring to as the array solution, though
I would probably write it like this to make it symmetrical:
minmax = LastValue( HHV( abs( m ), r ) );
It would be interesting if we could have a faster operation such that
if we used a SetBarsRequired( r, 0 )
Dennis -
Close, but not quite. If you were going to use SetBarsRequired() to
control the lookback, it is CRITICAL that it be the LAST statement in
the program. If it is not, subsequent statements ( such as HHV() ) may
add to the requirement. If you want to see a detailed explanation of
this,
Bruce,
Yes, I understand the SBR requirements. My AFLs have it as the last
statement. The thing I was showing below was some wishful thinking if
the way SBR worked were modified to allow for reducing the number of
bars at each call. In fact it would be good to iterate how it works
here
maybe
IF ( MACDline == Signalline) // histogram value equals zero
X = lastvalue(MACDline);
Plot (X,, colorblack);
--- In amibroker@yahoogroups.com, Dennis Brown se...@... wrote:
Yes, I have it set to 100%. The absolute values of the indicator will
vary wildly, depending on the price
maybe
IF ( MACDline == Signalline) // histogram value equals zero
X = lastvalue(MACDline-Signalline);
Plot (X,, colorblack);
--- In amibroker@yahoogroups.com, Dennis Brown se...@... wrote:
Yes, I have it set to 100%. The absolute values of the indicator will
vary wildly, depending on
Maybe not...
Through this discussion, the problem has been reduced to aligning the
min/max range of a MACD styleOwnScale plot to another zero line
styleOwnScale plot statement. Therefore, the only way to do this is
to find the min/max values of the MACD function in the visible bars
range
Herman,
Sorry, that does not work.
What works is (Typing off the top of my head, untested):
MACDind = MACD( whateverParameters );
AbsoluteRange = MACD[LastVisibleBar];
for ( i = FirstVisibleBar; i LastVisibleBar; i++ ) { AbsoluteRange =
Max( AbsoluteRange, abs( MACDind[i] ) ); }
Plot(
MACDInd = MACD(PeriodFast, PeriodSlow );
SigInd = Signal(PeriodFast, PeriodSlow , PeriodSignal );
Zero = 0;
Plot( MACDInd, , colorBlue);
Plot( SigInd , , colorRed);
Plot( Zero, , colorBlack);
--- In amibroker@yahoogroups.com, Dennis Brown se...@... wrote:
Hello,
This must be simple, but my
Sorry, but this does not work on a price chart as an overlay. This
will take over the right axis scale which is already in use for the
price.
Plot the MACDInd as styleOwnScale on top of a price chart and you will
see what I mean.
Thanks anyway,
Dennis
On Jun 26, 2009, at 3:10 PM,
Dennis,
Hi. You might try this- Place a value in minvalue section but none in maxvalue
section [I think maybe a value like 2 equates to 1/2 pane height] of your MACD
and zero plot statements. Also,styleNoRescale in the zero plot statement.
This worked for me when I wanted to plot a histogram
Dan,
This is what I usually do for indicators when I know the range of
values. However, MACD is an unbounded indicator, so I don't know how
large the values are. It is only the zero crossings and relative
peaks that are useful info here.
I just thought there would be some simple
16 matches
Mail list logo