[amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-29 Thread sidhartha70
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

[amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-29 Thread bruce1r
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

Re: [amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-28 Thread Tony Grimes
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,

[amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-28 Thread bruce1r
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

Re: [amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-28 Thread Dennis Brown
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

Re: [amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-28 Thread Dennis Brown
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 )

[amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-28 Thread bruce1r
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,

Re: [amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-28 Thread Dennis Brown
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

[amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-27 Thread gmorlosky
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

[amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-27 Thread gmorlosky
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

Re: [amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-27 Thread Dennis Brown
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

Re: Re[2]: [amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-27 Thread Dennis Brown
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(

[amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-26 Thread gmorlosky
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

Re: [amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-26 Thread Dennis Brown
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,

[amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-26 Thread monitorit
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

Re: [amibroker] Re: Brain fried, How do I plot a zero line on my MACD

2009-06-26 Thread Dennis Brown
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