[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: MACD Signal Value



PureBytes Links

Trading Reference Links

Does the LastValue give you the current bar while AMIBroker is 
processing all the data through its loop? I think the lastvalue is 
the very last element in the array?

--- In amibroker@xxxxxxxxxxxxxxx, "wavemechanic" <timesarrow@xxx> 
wrote:
>
> Take a look at lastvalue() and selectedvalue() and then one way to 
go is:
> 
> if(lastvalue(macd_signal > 0)
> {
>     code
> }
> 
> 
> Bill
>   ----- Original Message ----- 
>   From: patsgreatdeals 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Sunday, May 18, 2008 10:58 AM
>   Subject: [amibroker] MACD Signal Value
> 
> 
>   I am looking to get the value of the MACD Signal line to test if 
it 
>   is over/under 0.
> 
>   The code below (taken from AMIBroker MACD indicator) will give 
the 
>   the signal and I can plot it, but how do I check the value for 
the 
>   current bar?
> 
>   MACDr1 = Param( "Fast avg", 12, 2, 200, 1 );
>   MACDr2 = Param( "Slow avg", 26, 2, 200, 1 );
>   MACDr3 = Param( "Signal avg", 9, 2, 200, 1 );
> 
>   //MACD Signal Line
>   MACD_Signal = Signal(MACDr1,MACDr2,MACDr3);
> 
>   //Plot it just for a test
>   Plot(MACD_Signal,"MACD VALUE", colorBlue, styleLine );
> 
>   //Now I want to know the value of the current day
>   if (MACD_Signal > 0)
>   {
>     //perform some other logic for buy/sells.....
>   }
> 
>   Question: MACD_Signal is an array at this point (per the error in 
the 
>   AFL Editor) how to I get the current value for the current bar? 
> 
> 
> 
> 
>   ------------------------------------
> 
>   Please note that this group is for discussion between users only.
> 
>   To get support from AmiBroker please send an e-mail directly to 
>   SUPPORT {at} amibroker.com
> 
>   For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>   http://www.amibroker.com/devlog/
> 
>   For other support material please check also:
>   http://www.amibroker.com/support.html
>   Yahoo! Groups Links
> 
> 
> 
> 
> 
> --------------------------------------------------------------------
----------
> 
> 
> 
>   No virus found in this incoming message.
>   Checked by AVG. 
>   Version: 8.0.100 / Virus Database: 269.23.20/1453 - Release Date: 
5/18/2008 9:31 AM
>



------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/