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

Re: [amibroker] Question on VarSet and VarGet for Tomasz and programming gurus



PureBytes Links

Trading Reference Links

For what it is worth, here is how I change colors.  I find that this
arrangement of sequentially stacking the    iif(   statements on top of each
other helps my thinking as am creating a new indicator.  Ron D




Ywtchcolorr=IIf(WYTouchr,colorBrightGreen,colorYellow);

Wytchcolorr=IIf(WYTouchr,colorBrightGreen,Ywtchcolorr);

Wdcolorr=IIf(Wdipr,colorBlue,Wytchcolorr);

Wtcolorr=IIf(Wtopr,colorRed,Wdcolorr);

Wcolorr=IIf(WYTouchr OR Xywr OR Xwyr,colorBrightGreen,Wtcolorr);


============================================================================
===================


----- Original Message ----- 
From: "Jo" <amibroker@xxxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, July 10, 2004 7:53 AM
Subject: [amibroker] Re: Changing histogram bar color


> Hi Graham
>
> Thanks for your help.
>
> > Why are you using Graph when plot is much easier and all fits all
> The answer to that is easy... I don't know what I'm doing :)  I'm not
> programmer, I just know enough to try and modify others code.
>
> A slight correction to your code (rearranged the brackets) produces
> the histogram but doesn't produce the desired result. Bars are all
> green or red.
>
> Plot(CCI (ST) , "", IIf( CCI(ST) >= 0, IIf( BarsSince (Cross ( CCI(ST)
> , 0 )<=5), colorPaleGreen, colorGreen ),
> IIf( BarsSince (Cross ( 0, CCI(ST) )<=5), colorPink, colorRed )),
> styleHistogram );
>
> I'll have a play when I get a chance.
>
> Johno
> --- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> wrote:
> > Why are you using Graph when plot is much easier and all fits all
> settings
> > into a single line
> >
> > Plot(CCI (ST) , "", iif( cci(st) >= 0, iif( barssince (cross (
> cci(st) , 0 )
> > <=5, colorpalegreen, colorgreen ),  iif( barssince (cross ( 0,
> cci(st) )
> > <=5, colorpink, colorred )), stylehistogram );
> >
> >
> > I think I have the brackets in right places, and the right number of
> them
> > :-)
> >
> > Cheers,
> > Graham
> > http://e-wire.net.au/~eb_kavan/
> >
> > -----Original Message-----
> > From: Jo [mailto:amibroker@x...]
> > Sent: Saturday, July 10, 2004 7:55 PM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Changing histogram bar color
> >
> > I'm trying to refine a CCI indicator by changing the bar color after
> > the 5th bar above or below the 0 line. The indicator is almost
> > complete but I'm stuck on changing the histogram bar color.
> >
> > Basics are;
> > if barcount since cross above 0 line < 6, barcolor = palegreen else
> > barcolor = green
> >
> > if barcount since cross below 0 line < 6, barcolor = pink else
> > barcolor = red
> >
> >
> > AFL code so far is:
> > /* Woodie's CCI V3*/
> >
> > //Standard CCI
> > ST = 21;
> > //Turbo CCI
> > T = 8;
> >
> > MaxGraph = 5;
> > LSMA25 = LinearReg( Close, 25 );
> > LSMA45 = LinearReg( Close, 45 );
> >
> > //Plot Standard CCI
> > Graph2 = CCI (ST);
> >
> > Uptrend = 1;  Downtrend =  -1;
> >
> > //Color bars Green > 0, Red < 0
> > Graph2BarColor = IIf (Graph2 > uptrend, colorGreen, IIf (Graph2 <
> > downtrend,4,6));
> >
> > Graph4 = Graph2;
> > Graph4Style = 4;
> >
> > //Plots Turbo CCI
> > Plot(CCI (T),"Turbo",colorYellow,styleLine);
> > Plot(2,"ribbon", IIf (C>LSMA25,
> > colorGreen,colorRed),styleArea|styleNoLabel,  1, 1000 );
> >
> > // Plot range lines
> > Plot(200,"",colorRed);
> > Plot(-200,"",colorRed);
> > Plot(100,"",colorBlue);
> > Plot(-100,"",colorBlue);
> > PlotGrid(50,colorBlack);
> > PlotGrid(-50,colorBlack);
> > PlotGrid(150,colorBlack);
> > PlotGrid(-150,colorBlack);
> >
> > Title = "  " + Name () + "   "  + FullName() + "  " + "CCI period"
> + "
> > =" + WriteVal(ST);
> >
> >
> >
> >
> > Check AmiBroker web page at:
> > http://www.amibroker.com/
> >
> > Check group FAQ at:
> > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > Yahoo! Groups Links
>
>
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> Yahoo! Groups Links
>
>
>
>
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

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

<*> 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/