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

[amibroker] Re: Calculate distance



PureBytes Links

Trading Reference Links

Thanks for the quick response Ed!  Works like a charm.

John


--- In amibroker@xxxxxxxxxxxxxxx, "ed" <ed2000nl@xxxx> wrote:
> see manual: you need to use:  50 - RSI(n)
> 
> because with PositionScore the scores are sorted according to the 
absolute value of PositionScore. 
> 
> RSI moves between 0 and 100.    50 - RSI(n) results in an array 
ranging between -50 and 50. Position score remembers the sign and 
will use a positive number for a LONG entry and a negative number for 
a SHORT entry. On the other hand to decide whether to take a long or 
a short trade it uses the absolute value.
> 
> So if the PositionScore results in -34, 36 and we only may enter 1 
trade then it takes the absolute value and finds 36 as the best 
entry. Looking at the sign it knows that it should be a LONG trade 
entry because 36 is a positive number.
> 
> rgds, Ed 
> 
> 
>   ----- Original Message ----- 
>   From: fsmart21 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Friday, July 23, 2004 6:57 PM
>   Subject: [amibroker] Question regarding position score
> 
> 
>   How can I assign a different position score for buy and short 
trades 
>   within the same formula?
> 
>   Current PS:
> 
>   PositionScore =ValueWhen( Cross( PDI(n), MDI(n) ), RSI(n2), 0);
> 
>   This works fine for buy orders, but not short orders.  Need this 
PS 
>   for short:
> 
>   PositionScore =ValueWhen( Cross( PDI(n), MDI(n) ), 100-RSI(n2), 
0);
> 
>   But how do I build this into one formula?
> 
>   Right now my short signals are being ranked based on the highest 
RSI, 
>   but I need them ranked on lowest RSI.
> 
>   Thanks,
> 
>   John
> 
> 
> 
>   Check AmiBroker web page at:
>   http://www.amibroker.com/
> 
>   Check group FAQ at: 
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> 
>         Yahoo! Groups Sponsor 
>               ADVERTISEMENT
>              
>        
>        
> 
> 
> --------------------------------------------------------------------
----------
>   Yahoo! Groups Links
> 
>     a.. To visit your group on the web, go to:
>     http://groups.yahoo.com/group/amibroker/
>       
>     b.. To unsubscribe from this group, send an email to:
>     amibroker-unsubscribe@xxxxxxxxxxxxxxx
>       
>     c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/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/