ADE

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
miltonc4
Posts: 150
Joined: 14 Apr 2006
Has thanked: 1 time
Been thanked: 3 times

ADE

Postby miltonc4 » 06 Jun 2008

Hi All
Last time I tried had problems with MCharts and ADE
Is anyone using it OK now

I have an indicator that draws a vertical line in a chart,in this case a 10 min chart,and hope to be able to automatically draw the sameT rend Line in a 2 point chart when it appears in the 10 min, by using ADE.

Anyone see any problem with this ?
Thanks
Milton

User avatar
Geoff
Posts: 198
Joined: 18 Apr 2007
Has thanked: 15 times
Been thanked: 4 times

Postby Geoff » 06 Jun 2008

I have been using ADE with MultiCharts and never experienced any problems.

miltonc4
Posts: 150
Joined: 14 Apr 2006
Has thanked: 1 time
Been thanked: 3 times

Postby miltonc4 » 07 Jun 2008

Thanks Geoff

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Re: ADE

Postby Marina Pashkova » 11 Jun 2008

Hi All
Last time I tried had problems with MCharts and ADE
Is anyone using it OK now

I have an indicator that draws a vertical line in a chart,in this case a 10 min chart,and hope to be able to automatically draw the sameT rend Line in a 2 point chart when it appears in the 10 min, by using ADE.

Anyone see any problem with this ?
Thanks
Milton


Hi Milton,

Have you been able to solve the problem yet? From what I know, our customers are using ADE without any issues.

If you need assistance, please contact us via LiveChat.

miltonc4
Posts: 150
Joined: 14 Apr 2006
Has thanked: 1 time
Been thanked: 3 times

Postby miltonc4 » 13 Jun 2008

Hello marina

I havent had the time to devote to it as yet,but have now got ADE installed,just need to play with it
Will let you know later
Milton

miltonc4
Posts: 150
Joined: 14 Apr 2006
Has thanked: 1 time
Been thanked: 3 times

Postby miltonc4 » 16 Jun 2008

Hi Geoff and Marina

Going thru a steep learning curve,but I am stuck ?

Have a 10 min chart with MACD BB indicator that plots a verticle line
if MACDVal crosses over BBMid and if MACDVal crosses under BBMid

I basically,want to plot the line from the 10 min chart as soon as it appears in 10 min.into the 2 min chart and other style charts rather than do it manually as I do now

My problem is I don’t know how to get started
I believe I need to create an ELC.Sender and ELC receiver for this to happen in RealTime. Have been studying Maps as well ?


Have converted the ADU.MACD to an ADU.MACD BB that plots the lines OK

Does anyone have any examples of how I can do this or similar inputs/variables,even if it is for moving averages etc that I could modify
Not sure what Inputs and Vars are needed ?

Below is the ADU.MACD BB indicator(….my crude cut and paste ?as my programming skills are ordinary)

Thanks for the help
Milton

Code: Select all

[LegacyColorValue = TRUE];

{ ADU MACD

v1.0

mmillar, October 2005
}

Inputs:      FastLength(12),
         SlowLength(26),
         MACDLength(9),
         Interval(ADE.BarInterval),   // number of minutes, or ADE.Daily, ADE.Weekly, ADE.Monthly
         DeriveBars(0),
         Sym(GetSymbolName),
         UseFile(ADE.UseFile),// default UseFile is returned by ADE.UseFile function
         
Length( 20 ),          
NumDevsUp( 1 ),
NumDevsDn( -1 ),
Displace( 0 ) ,
StopDevsUp( 1.7 ),
StopDevsDn( -1.7 ), 

//Below plots verticle BLUE Line on Chart    
{Time_         (1000), }
upHeight         (200),
upWidth         (1), 
{upStyle         (tool_dashed),}
upStyle         (tool_solid),
upColor         (blue), 

 //Below plots verticle RED Line on chart   
{Time_         (1000), }
dnHeight         (200),
dnWidth         (1), 
{dnStyle         (tool_dashed),}
dnStyle         (tool_solid),
dnColor         (Red), 

//Below plots Verticle Line in SubChart2 *******************************
{Time_         (1000), }
SubupHeight         (2000),
SubupWidth         (1), 
{dnStyle         (tool_dashed),}
SubupStyle         (tool_solid),
SubupColor         (Blue), 

//Below plots Verticle Line in SubChart2 *********************************
{Time_         (1000), }
SubdnHeight         (2000),
SubdnWidth         (1), 
{dnStyle         (tool_dashed),}
SubdnStyle         (tool_solid),
SubdnColor         (Red); 
 



Vars:      MyMACD(0),
      MACDAvg(0),
      {PrevMACDAvg(0),}
      {MACDDiff(0),}
      SmoothingFactor( 2 / ( MACDLength + 1 ) ),
      Class("OHLCV"),
MACDVal( 0 ),
BBMid( 0 ),
SDev( 0 ),
LowerBand( 0 ),
UpperBand( 0 ) ,
Candle (0),

StopBBMid( 0 ),
StopSDev( 0 ),
StopLowerBand( 0 ),   
StopUpperBand( 0 ) ,

//Below plots verticle Line on Chart
upHeight_ (MinMove / PriceScale * upHeight), 
upID    (-1), 
dnHeight_ (MinMove / PriceScale * upHeight), 
dnID    (-1), 

//Below plots verticle Line in SubChart2**********************************
SubupHeight_ (MinMove / PriceScale * SubupHeight), 
SubupID    (-1), 
SubdnHeight_ (MinMove / PriceScale * SubupHeight), 
SubdnID    (-1); 

MACDVal = MACD( Close, FastLength, SlowLength ) ;
MACDAvg = XAverage( MACDVal, MACDLength ) ;
BBMid = AverageFC( MACDVal, Length ) ;
SDev = StandardDev( MACDVal, Length, 1 ) ;
UpperBand = BBMid + NumDevsUp * SDev ;
LowerBand = BBMid + NumDevsDn * SDev ;

StopBBMid = AverageFC( MACDVal, Length ) ;
StopSDev = StandardDev( MACDVal, Length, 1 ) ;
StopUpperBand = StopBBMid + StopDevsUp * StopSDev ;
StopLowerBand = StopBBMid + StopDevsDn * StopSDev ;


if CurrentBar = 1 then begin
   if UseFile then
      Value1 = ADE.OpenMap(Class, Sym, Interval);
   if DeriveBars <> 0 and Class <> "OHLCV" then
      Value1 = ADE.RaiseError("Higher timeframe bars can only be derived for the 'OHLCV' class.");
end;

if DeriveBars = 0 or ADE.DeriveBigBar(Interval) then begin
   if ADE.OnNextBar(Class, Sym, Interval) then Begin
      MyMACD = ADF.MACD(Class, Sym, Interval, ADE.BarID, "Close", FastLength, SlowLength);

      {PrevMACDAvg = MACDAvg;
      MACDAvg = PrevMACDAvg + SmoothingFactor * ( MyMACD - PrevMACDAvg );}
         
      {MACDDiff = MyMACD - MACDAvg;}
   end;
end;
 
MACDVal = MACD( Close, FastLength, SlowLength ) ;
MACDAvg = XAverage( MACDVal, MACDLength ) ;
BBMid = AverageFC( MACDVal, Length ) ;
SDev = StandardDev( MACDVal, Length, 1 ) ;
UpperBand = BBMid + NumDevsUp * SDev ;
LowerBand = BBMid + NumDevsDn * SDev ;
 
if Displace >= 0 or CurrentBar > AbsValue( Displace ) then 
   begin
   {Plot5( MACDVal, "MACD",yellow) ;}
      {Plot6( MACDAvg, "MACDAvg", White ) ;}
   Plot7[Displace]( BBMid, "MidLine" ) ;
   Plot8[Displace]( UpperBand, "UpperBand" ) ;
   Plot9[Displace]( LowerBand, "LowerBand" ) ;
   {Plot10( 0, "ZeroLine", Yellow) ; }


Plot11[Displace]( StopBBMid, "StopMidLine" ) ;
Plot12[Displace]( StopUpperBand, "StopUpperBand" ) ;
Plot13[Displace]( StopLowerBand, "StopLowerBand" ) ;
 
   If MACDVal>UpperBand Then
      SetPlotColor(1,Green);
         
   If MACDVal<LowerBand Then
      SetPlotColor (1,red);

//Below plots verticle BLUE Line on Chart   
if MACDVal crosses over BBMid //Plots a single Vertical BLUE Line
   
then begin 
   upID = TL_New(Date,time,Low-upHeight_,Date,time,High+upHeight ); 
   Value1 = TL_SetColor(upID, upColor); 
   value1 = TL_SetStyle(upID, upStyle); 
   value1 = TL_SetSize(upID, upWidth); 
end;
 
//Below plots verticle Red Line on Chart   
if MACDVal crosses under BBMid //Plots a single Vertical RED Line
   
then begin 
   dnID = TL_New(Date,time,Low-dnHeight_,Date,time,High+dnHeight ); 
   Value1 = TL_SetColor(dnID, dnColor); 
   value1 = TL_SetStyle(dnID, dnStyle); 
   value1 = TL_SetSize(dnID, dnWidth); 
end; 
//Below plots Verticle Line in SubChart2 *******************************
 if MACDVal crosses over BBMid //Plots a single Vertical GREEN Line
   
then begin 
   SubupID = TL_New_self(Date,time,myMACD-SubupHeight_,Date,time,myMACD+SUBdnHeight ); 
   Value1 = TL_SetColor(SubupID, SubupColor); 
   value1 = TL_SetStyle(SubupID, SubupStyle); 
   value1 = TL_SetSize(SubupID, SubupWidth); 
end; 


//Below plots Verticle Line in SubChart2 *******************************
 if MACDVal crosses under BBMid //Plots a single Vertical RED Line
   
then begin 
   SubdnID = TL_New_self(Date,time,myMACD-SubdnHeight_,Date,time,myMACD+SubdnHeight ); 
   Value1 = TL_SetColor(SubdnID, SubdnColor); 
   value1 = TL_SetStyle(SubdnID, SubdnStyle); 
   value1 = TL_SetSize(SubdnID, SubdnWidth); 
end; 

      

Plot1( MACDVal, "MACD") ;
Plot2( MACDAvg, "MACDAvg" ) ;
{Plot3( MACDDiff, "MACDDiff" ) ;}
Plot4( 0, "ZeroLine" ) ;

{ Alert criteria }
{if MACDDiff crosses over 0 then
   Alert( "Bullish alert" )
else if MACDDiff crosses under 0 then
   Alert( "Bearish alert" ) ; }

if Displace <= 0 then
      begin
      if MACDVal crosses under LowerBand then
         Alert( "MACD under lower BB" ) 
      else if MACDVal crosses over UpperBand then
         Alert( "MACD over upper BB" ) ;
      end ;
    
end ;   






Return to “User Contributed Studies and Indicator Library”