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

Re: [amibroker] IIF statement not making simple decsion based on REF statement.



PureBytes Links

Trading Reference Links

Single plot, 2 colours
Plot( sar_flexible, "Up SAR", IIf( sar_flexible >
Ref(sar_flexible,-1), colorGreen,colorRed ), styleDots | styleNoLine |
styleThick ),

OR for 2 plots


Plot( IIf( sar_flexible > Ref(sar_flexible,-1),sar_flexible,null), "Up
SAR", colorGreen, styleDots | styleNoLine |styleThick );
Plot( IIf( sar_flexible > Ref(sar_flexible,-1),null,sar_flexible),
"Down SAR", colorRed, styleDots | styleNoLine |styleThick ));

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


On 22/01/2008, gmorlosky <gmorlosky@xxxxxxxxx> wrote:
> I'm using the proven AmiBroker formula of SAR of RSI. Problem is that
> my "UpSAR" and "DownSAR" are always the same plot values, so I never
> see the other plot color. I'm trying to make a simple IIF statement
> based on REF of one day ago to plot green for upswing and red for
> downswing. Any help is appreciated.
>
> //Title = "SAR Of RSI";
>
> Plot( RSI(14), "RSI", colorBlue, styleThick );
>
> P = ParamField("Price field",-1);
>
> oldo = O; oldh = H; oldl = L; oldc = C; oldv = V;
>
> O = H = L = C = p;
> sar_flexible = SAR();
>
> O = oldo; H = oldh; L = oldl; C = oldc; V = oldv;
>
> /* split the plotting to green for upswing and red for downswing */
>
> IIf( sar_flexible > Ref(sar_flexible,-1),
> Plot( sar_flexible, "Up SAR", colorGreen ,styleDots | styleNoLine |
> styleThick ),
> Plot( sar_flexible, "Down SAR", colorRed ,styleDots | styleNoLine |
> styleThick ));
>
> GraphXSpace = 5;
>
>
>
> 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
>
>
>
>


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/