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

[EquisMetaStock Group] Help with coding an indicator



PureBytes Links

Trading Reference Links

Hello All,

I want to code a specific indicator but not sure how to even begin 
coding it :-(

Basically, I want to add a moving line to my price chart which will 
act as a stop loss.

This new line (called "Stop Line") should be 2 x the Average True 
Range (ATR) below price (close). As price moves upwards, this new 
line should be recalculated using the next days price (close) and its 
ATR.

However, if the price declines, the "Stop Line" should remain at the 
previous level and NOT be recalculated.  In other words, the "Stop 
Line" should only move upwards or horizontal but never downwards.

Once price crosses back below the "Stop Line",  the line should then 
be "reset" and return to 2 x ATR below current price (close). 

In summary:

1.  "Stop Line" is calculated as:  Current close - 2x Average True 
Range (ATR) 
2.  On the next day:  If close is higher than previous day, then 
repeat step 1, else keep current value ie. "Stop Line" moves 
horizontal at same value from previous day
3. Repeat step 2, until close < "Stop Line"
4. Once close < "Stop Line", return to step 1

Any help much appreciated,

Many Thanks....

CCH



 
Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/