Please help for diosc

#1
I'm using the new Amibroker.If you have diosc formula please share afl code.

First :
I want to calculate differences of the distance between + d and -d and this have to oscillator.I think this is name diosc

Second:

I want to draw a moving average on the diosc
 

amanfree

Active Member
#2
I'm using the new Amibroker.If you have diosc formula please share afl code.

First :
I want to calculate differences of the distance between + d and -d and this have to oscillator.I think this is name diosc

Second:

I want to draw a moving average on the diosc
Please elaborate further and if possible post the image of charts as well.
 
#3
Thanks for the reply...What I want to make the difference between + D and -D to make an oscillator..I will try to add an image
 
Last edited:
#4
I found this..It is not same but help in editing

and I would like to add moving averages code into this formulas



_SECTION_BEGIN("New formula");
//------------------------------------------------------------------------------
//
// Formula Name: DMI Spread Index
// Author/Uploader: Steve Wiser
// E-mail: [email protected]
// Date/Time Added: 2001-07-05 19:13:58
// Origin:
// Keywords:
// Level: basic
// Flags: system,exploration,indicator
// Formula URL: http://www.amibroker.com/library/formula.php?id=59
// Details URL: http://www.amibroker.com/library/detail.php?id=59
//
//------------------------------------------------------------------------------
//
// Uses DMI Spread Index as a system, indicator and exploration
//
//------------------------------------------------------------------------------

/* Settings setup should have buy and sell at open with one day delay. I also use a 5%
maximum stop loss. This code also plots the DMI Index in its own chart pane. Note that I
have also provided a zero line for better viewing of the zero cross.*/

/* Exploration, System and Indicator
Author Steve Wiser
Email address: [email protected]
May 5, 2001 */

Percent=3;
pds=PeakBars(C,Percent,2)-PeakBars(C,Percent,1);
pds=LastValue(pds);

/* the following code is for the consolidation periods or better know
as the sleeping Alligator */

var3= 5;
var4= 3;
var10=10;
var0= Ref(Wilders(C,13),-8);
var1= Ref(Wilders(C,8),-5);
var2= Ref(Wilders(C,5),-3);
var5= MA((var0+var1+var2),var4) ;
angle=atan(var5-Ref(var5,-var3)/var3);
angle=IIf( angle >90,angle-360,angle);
hope=IIf( angle <20 AND angle>-20,1,0);
cry=((StDev(C,var3*2) - Ref(Wilders(StDev(C,var3*2),8),-5))/
(Ref(Wilders(StDev(C,var3*2),8),-5)))<0;

/* End of Sleeping Alligator which is an area of little or no volitlity or price movement.*/

SI=MA(PDI(pds)-MDI(pds),5);
Graph0=SI; /* Spread Index */
Graph1=0; /* Provides a zero based line of blue color */
Graph1Style=5;

Buy=Cross(SI,0) ;
/* or PDI(14)>MDI(14) and ADX(14)>MDI(14) and (Hope and Cry)==0;*/
/* Having PDI and ADX and (Hope and Cry) does not test as well */
Sell=Cross(0,SI) OR ADX(14)<MDI(14) AND PDI(14)<MDI(14);

Buy=ExRem(Buy,Sell); /* this removes redundant buy/sell signals */
Sell=ExRem(Sell,Buy);

Short=Sell;
Cover=Buy;

/* The following code is the exploration code */

Filter=( /*ref(Buy,-1)==0 and*/ (Buy==1) );
NumColumns = 7;
Column0 =Ref(C+0.065,-1);
Column0Format = 1.2;
Column0Name = "Trigger Price";
Column1 = C;
Column1Name = "Close ";
Column1Format = 1.2;
Column2 = MA(V,17);
Column2Name = "17 Ma Vol ";
Column2Format = 1.0;
Column3 = MA(C,17)/MA(C,50);
Column3Name = "% 17/50 ";
Column3Format = 1.2;
Column3Format = 1.2;
Column4= MA(C,17);
Column4Name="17 C ma";
Column4Format = 1.2;
Column4= MA(C,50);
Column4Name="50 C ma";
Column4Format = 1.2;
Column5=SI;
Column5Name="DMI Index";
Column5Format=1.2;
Column6=ROC(SI,3);
Column6Name="ROC of SI";
Column6Format=1.2;
/* End of Exploration Code. */
_SECTION_END();
 

amanfree

Active Member
#5
I found this..It is not same but help in editing

and I would like to add moving averages code into this formulas



_SECTION_BEGIN("New formula");
//------------------------------------------------------------------------------
//
// Formula Name: DMI Spread Index
// Author/Uploader: Steve Wiser
// E-mail: [email protected]
// Date/Time Added: 2001-07-05 19:13:58
// Origin:
// Keywords:
// Level: basic
// Flags: system,exploration,indicator
// Formula URL: http://www.amibroker.com/library/formula.php?id=59
// Details URL: http://www.amibroker.com/library/detail.php?id=59
//
//------------------------------------------------------------------------------
//
// Uses DMI Spread Index as a system, indicator and exploration
//
//------------------------------------------------------------------------------

/* Settings setup should have buy and sell at open with one day delay. I also use a 5%
maximum stop loss. This code also plots the DMI Index in its own chart pane. Note that I
have also provided a zero line for better viewing of the zero cross.*/

/* Exploration, System and Indicator
Author Steve Wiser
Email address: [email protected]
May 5, 2001 */

Percent=3;
pds=PeakBars(C,Percent,2)-PeakBars(C,Percent,1);
pds=LastValue(pds);

/* the following code is for the consolidation periods or better know
as the sleeping Alligator */

var3= 5;
var4= 3;
var10=10;
var0= Ref(Wilders(C,13),-8);
var1= Ref(Wilders(C,8),-5);
var2= Ref(Wilders(C,5),-3);
var5= MA((var0+var1+var2),var4) ;
angle=atan(var5-Ref(var5,-var3)/var3);
angle=IIf( angle >90,angle-360,angle);
hope=IIf( angle <20 AND angle>-20,1,0);
cry=((StDev(C,var3*2) - Ref(Wilders(StDev(C,var3*2),8),-5))/
(Ref(Wilders(StDev(C,var3*2),8),-5)))<0;

/* End of Sleeping Alligator which is an area of little or no volitlity or price movement.*/

SI=MA(PDI(pds)-MDI(pds),5);
Graph0=SI; /* Spread Index */
Graph1=0; /* Provides a zero based line of blue color */
Graph1Style=5;

Buy=Cross(SI,0) ;
/* or PDI(14)>MDI(14) and ADX(14)>MDI(14) and (Hope and Cry)==0;*/
/* Having PDI and ADX and (Hope and Cry) does not test as well */
Sell=Cross(0,SI) OR ADX(14)<MDI(14) AND PDI(14)<MDI(14);

Buy=ExRem(Buy,Sell); /* this removes redundant buy/sell signals */
Sell=ExRem(Sell,Buy);

Short=Sell;
Cover=Buy;

/* The following code is the exploration code */

Filter=( /*ref(Buy,-1)==0 and*/ (Buy==1) );
NumColumns = 7;
Column0 =Ref(C+0.065,-1);
Column0Format = 1.2;
Column0Name = "Trigger Price";
Column1 = C;
Column1Name = "Close ";
Column1Format = 1.2;
Column2 = MA(V,17);
Column2Name = "17 Ma Vol ";
Column2Format = 1.0;
Column3 = MA(C,17)/MA(C,50);
Column3Name = "% 17/50 ";
Column3Format = 1.2;
Column3Format = 1.2;
Column4= MA(C,17);
Column4Name="17 C ma";
Column4Format = 1.2;
Column4= MA(C,50);
Column4Name="50 C ma";
Column4Format = 1.2;
Column5=SI;
Column5Name="DMI Index";
Column5Format=1.2;
Column6=ROC(SI,3);
Column6Name="ROC of SI";
Column6Format=1.2;
/* End of Exploration Code. */
_SECTION_END();
i will try to do it this week end.
 

amanfree

Active Member
#6
Code:
_SECTION_BEGIN("ADX- Oscillator");
range = Param(" ADX Periods", 14, 2, 200, 1 );
diff = PDI(range) - MDI(range);
total = PDI(range) + MDI(range);
Osc = diff / total;
Plot( Osc , "DI_Osc", colorRed, ParamStyle("-DI style") );
MArange = Param(" MA Periods", 5, 2, 200, 1 );
MAvalue = MA( Osc , MArange );
Plot( MAvalue , "MA of DI_Osc", colorBlue );
_SECTION_END();
By default ADX period is set to 14 and simple MA to 5.

How are u going to use this, please explain
 
#7
Code:
_SECTION_BEGIN("ADX- Oscillator");
range = Param(" ADX Periods", 14, 2, 200, 1 );
diff = PDI(range) - MDI(range);
total = PDI(range) + MDI(range);
Osc = diff / total;
Plot( Osc , "DI_Osc", colorRed, ParamStyle("-DI style") );
MArange = Param(" MA Periods", 5, 2, 200, 1 );
MAvalue = MA( Osc , MArange );
Plot( MAvalue , "MA of DI_Osc", colorBlue );
_SECTION_END();
By default ADX period is set to 14 and simple MA to 5.

How are u going to use this, please explain
My friend "amanfree" thank you for help...My aim to catch tops and bottoms of +d and -d before intersection..because intersection too late to catch the trend..So I accept the contraction of the distance between the point..to identify peaks of diosc I se moving avarage of diosc..I try this good..thank yoı for help
 

amanfree

Active Member
#8
My friend "amanfree" thank you for help...My aim to catch tops and bottoms of +d and -d before intersection..because intersection too late to catch the trend..So I accept the contraction of the distance between the point..to identify peaks of diosc I se moving avarage of diosc..I try this good..thank yoı for help
most welcome bro
 

Similar threads