MultiCharts - Displaced Moving Average with Projection
futures io


Categories Help    

MultiCharts
MultiCharts Downloads / MultiCharts Indicators

Share MultiCharts indicators, EasyLanguage indicators.


Entries
Displaced Moving Average with Projection 2 *
Don't know if this will work to just post the text of the file in the description box here. Copy all code below here for indicator or text file attached. Pictures should explain. Indicator works fine.
////////////////////////////////


// Displaced Moving Average with Projection
//


inputs:
ShowProjection(True),
ST_upcol(blue),
ST_dncol(red),
LT_upcol(darkgreen),
LT_dncol(magenta),
Price( Close ),
FastLength( 9 ),
SlowLength( 18 ),
Displace( 0 ) ;

variables:
avg_st( 0 ),
avg_Lt( 0 ) ,
st_diff(0),
lt_diff(0),
st_color(0),
lt_color(0);

avg_st = AverageFC( Price, FastLength ) ;
avg_Lt = AverageFC( Price, SlowLength ) ;

condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;
if condition1 then
begin

if avg_st > avg_st[1] then st_color = st_upcol
else st_color = st_dncol;

if avg_lt > avg_lt[1] then lt_color = lt_upcol
else lt_color = lt_dncol;


Plot1[Displace]( avg_st, "FastAvg", st_color ) ;
Plot2[Displace]( avg_Lt, "SlowAvg", lt_color ) ;


if Displace <= 0 then
begin
condition1 = avg_st crosses over avg_Lt ;
if condition1 then
Alert( "Bullish alert" )
else
begin
condition1 = avg_st crosses under avg_Lt ;
if condition1 then
Alert( "Bearish alert" ) ;
end ;
end;
end ;


if ShowProjection and Displace > 0 then
begin

st_diff = avg_st - avg_st[1];
lt_diff = avg_lt - avg_lt[1];

for value1 = 1 to Displace
begin
plot1[Displace - value1](avg_st + st_diff* value1 ,"s", black);
plot2[Displace - value1](avg_lt + lt_diff* value1 ,"l", black);
end;
end;


Category MultiCharts 
 
Suggest other entries I might like
Details: Displaced Moving Average with Projection
Category: MultiCharts 


March 21st, 2010
Size: 1.36 KB
Downloaded: 318 times
 


 
Category
 



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.