Follow up to my previous enquiry to have one single STRATEGY or INDICATOR applied to MULTIPLE instruments? (To eliminate having multiple instances of the same STRATEGY or INDICATOR applied to each instrument)

For example I can implement a STRATEGY or an INDICATOR to EXIT positions of a specific instrument when its RSI indicator reaches a certain level.

But don`t know how to apply it to ALL instruments without having multiple instances of the same (one for each instrument)

-- Appling this indicator to to EUR/USD chart will exit EUR/USD long pos if EUR/USD avg[period] crosses below threshold -- and will exit EUR/USD short pos if EUR/USD avg[period] crosses above threshold.-- I wish to modify it to work also on an additional another instument say USD/JPY.-- I mean (I could) but do not want to have another instance applied it to a separate USD/JPY chart.-- Wish to have ONLY ONE instance to exit both EUR/USD and USD/JPY.

function Update(period) if period>first+nn then avg[period] = mathex.avg( source.close, period-nn, period) if avg[period]<thrsh and pos==1 then exit("B") end if avg[period]>thrsh and pos==-1 then exit("S") end endend

Who is online

FXCodeBase. The Ultimate source of the indicators and signals for the FXCM Trading Station and Marketscope applications

Forex Capital Markets, LLC. ("FXCM LLC") is an independent legal entity and is not affiliated with Gehtsoft USA LLC.http://fxcodebase.com is not owned, controlled, or operated by FXCM LLC. FXCM does not endorse any product or service of Gehtsoft USA LLC. Nothing associated with this promotion shall be considered a solicitation to buy or an offer to sell any product or service to any person in any jurisdiction where such offer, solicitation, purchase or sale would be unlawful under the laws or regulations of such jurisdiction.