Help for AMIBROKER CODE 100MA Trend Line Indicator

I would REALLY appreciate it if someone would help me with writing the AMIBROKER CODE for a SIMPLE 100MA Trend Line Indicator, which indicated swings/ trends using the following parameters:

• SIMPLE 100 bar moving average of the Close

• Overall Trend Line Direction has 3 possibilities:

– GREEN (Up), RED (Down), BLACK (Flat)

• GREEN changes to BLACK if 100MA is down and

price closes below 100MA in last 15 bars

inclusive of the current bar

• RED changes to BLACK if 100MA is more than

last bar’s 100MA and price closes above

100MA in last 15 bars inclusive of the current bar

• BLACK changes to GREEN if the 100MA is up for

15 consecutive bars inclusive of the current bar

• BLACK changes to RED if the 100MA is down for

15 consecutive bars inclusive of the current bar

• GREEN can never change to RED and RED can

never change to GREEN WITHOUT a BLACK period in between.

Enclosed is a Photoshop mock up of what I want.
Many Thanks!
 

Attachments

Back
Top