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

Re: [amibroker] Where is my mistake.



PureBytes Links

Trading Reference Links

2 ways to do this, also easier if you change the toggle around a bit

AVERAGES = ParamToggle("AVERAGES ON/OFF","OFF,ON",1);
if(Averages) Plot( MA( P, Periods ),"",  COND , Style); // this shows or removes the plot totally
OR
Plot( IIf(Averages, MA( P, Periods ),Null),"",  COND , Style); // this just makes the plot values the MA or null


--
Cheers
Graham Kav
AFL Writing Service
http://www.aflwriting.com


On 21/02/2008, Mohammed <softnews2003@xxxxxxxxx> wrote:

Hi,

I'm trying to set the Properties of moving Averages in the following code.

I would like to use ParamToggle ( On,Off) to show or hide the moving Average, But it is not working.
----------------------------------------------

UpColor = colorBrightGreen;
DownColor = colorRed;

_SECTION_BEGIN

("MA50");
UpColor =
ParamColor("Up Color",UpColor );
DownColor =
ParamColor("Down Color",DownColor );
STYLE =
ParamStyle("Style",styleDots );
AVERAGES =
ParamToggle("AVERAGES ON/OFF","ON,OFF",0);
_SECTION_END();

_SECTION_BEGIN

("MA");
P =
ParamField("Price field",-1);
Periods =
Param("Periods", 50, 2, 200, 1, 10 );
COND =
IIf( MA(P, Periods ) > Ref( MA(P, Periods ), -1 ), UpColor , DownColor );
Plot( MA( P, Periods ),"", AVERAGES | COND , Style);
_SECTION_END();
-----------------------------------------------
Any one can help please?

Regards


__._,_.___

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




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___