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

Re: [amibroker] Forex Grid



PureBytes Links

Trading Reference Links

Hi Klaus,

Here is some code I use to adjust for the fact that some forex pairs use 
2 decimals (JPY) and most use 4 decimals. Hope you can use it.

noPip= 100;
p1=  IIf(H-O=0,noPip,H-O);
p2=  IIf(O-L=0,noPip,O-L);
p3=  Abs(IIf(O-C=0,noPip,O-C));
p4=  IIf(H-C=0,noPip,H-C);
p5=  IIf(C-L=0,noPip,C-L);
p6=  IIf(H-L=0,noPip,H-L);
p7=  Abs(IIf(O-Ref(C,-1)=0,noPip,O-Ref(C,-1)));
minPip=  Min(p1,Min(p2,Min(p3,Min(p4,Min(p5, Min(p6,p7))))));
Pip=  prec(Lowest(minPip),4);

adjust=  IIf(Pip==0.0001, 0.0050, IIf(Pip==0.0100, 0.5,0));

[additional code here]

I'm not sure what you mean by a 'grid for forex' but the code above will 
help overcome the decimal place problem.

Cheers.

Klaus Korneker wrote:

> Hello,
>
>  
>
> i am trying to add a grid for forex. It should use the important key 
> levels like 0.0000, 0.0050, 0.0080
>
>  
>
> here is my code but it works not really good, especially in the usdjpy 
> it works not correct, but also on the majores when i view the whole 
> chart i see hundrets of lines. L
>
> Can someone help ?
>
>  
>
>  
>
> *if*(LastValue(*C*)>5)
>
> {
>
> Level = round(LastValue(*C*)*100)/100;
>
> Step1 = 0.0050;
>
> }
>
> *else*
>
> {
>
> Level = round(LastValue(*C*)*1)/1;
>
> Step1 = 0.50;
>
> }
>
>  
>
> *for* (i=0;i<10;i++){
>
> PlotGrid(level + i*Step1);
>
> }
>
>  
>
>  
>
>  
>
> Regards
>
>  
>
> Klaus
>
>
>
>
> 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 other support material please check also:
> http://www.amibroker.com/support.html
>
>
>
>
>
> SPONSORED LINKS
> Investment management software 
> <http://groups.yahoo.com/gads?t=ms&k=Investment+management+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=_XXUzbE9l5lGlZNcMu4KNQ> 
> 	Real estate investment software 
> <http://groups.yahoo.com/gads?t=ms&k=Real+estate+investment+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=5_sgDczz3ArKGMtJ9tFSJA> 
> 	Investment property software 
> <http://groups.yahoo.com/gads?t=ms&k=Investment+property+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=_N6zcwefgp4eg5n6oX5WZw> 
>
> Software support 
> <http://groups.yahoo.com/gads?t=ms&k=Software+support&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=MJ2jP31F3n64RDZkDadU8w> 
> 	Real estate investment analysis software 
> <http://groups.yahoo.com/gads?t=ms&k=Real+estate+investment+analysis+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=GmF8PlAJASx0wrSaX5-Zlw> 
> 	Investment software 
> <http://groups.yahoo.com/gads?t=ms&k=Investment+software&w1=Investment+management+software&w2=Real+estate+investment+software&w3=Investment+property+software&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Investment+software&c=6&s=200&.sig=aMgGsKT4w29dMAYUzQUKzg> 
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
>     *  Visit your group "amibroker
>       <http://groups.yahoo.com/group/amibroker>" on the web.
>        
>     *  To unsubscribe from this group, send an email to:
>        amibroker-unsubscribe@xxxxxxxxxxxxxxx
>       <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
>        
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

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