Amibroker For Dummies........a Beginner's Forum On How To Use Amibroker

will this thread serve its purpose?

  • yes

    Votes: 397 93.2%
  • no

    Votes: 29 6.8%

  • Total voters
    426

mindgames

Well-Known Member
Have a query on indicators.

I have inserted the ADX indicator. I would like to have separate smoothing period for ADX and DMI. How can this be done?

Thank you.
 
Have a query on indicators.

I have inserted the ADX indicator. I would like to have separate smoothing period for ADX and DMI. How can this be done?

Thank you.
You will have to right click, then edit formula and change the formula
 

mindgames

Well-Known Member
You will have to right click, then edit formula and change the formula
Thanks. I don't have a programming background and hence didn't want to tinker with the formula.

Anyway, after realizing that we can save our custom formulae separately, have made the following change using some guesswork / trial-error. Grateful if anyone with programming experience can confirm this is correct (I checked how this behaves on the chart after the edit, yet would like to confirm)

ORIGINAL AFL

_SECTION_BEGIN("ADX");
range = Param("Periods", 14, 2, 200, 1 );
Plot( ADX(range), _DEFAULT_NAME(), ParamColor( "ADX color", colorBlue ), ParamStyle("ADX style", styleThick ) );
Plot( PDI(range), "+DI", ParamColor( "+DI color", colorGreen ), ParamStyle("+DI style") );
Plot( MDI(range), "-DI", ParamColor( "-DI color", colorRed ), ParamStyle("-DI style") );
_SECTION_END();
ALTERED AFL

_SECTION_BEGIN("ADX");
range = Param("Periods", 14, 2, 200, 1 );
range1 = Param("Period DI", 14, 2, 200, 1 );
Plot( ADX(range), _DEFAULT_NAME(), ParamColor( "ADX color", colorBlue ), ParamStyle("ADX style", styleThick ) );
Plot( PDI(range1), "+DI", ParamColor( "+DI color", colorGreen ), ParamStyle("+DI style") );
Plot( MDI(range1), "-DI", ParamColor( "-DI color", colorRed ), ParamStyle("-DI style") );
_SECTION_END();
All that I have done is:
1/ Added the line "range 1 =........" (in red) to the original code; and
2/ Changed "range" to "range1" in the Plot(PDI) and Plot(MDI) lines.

Good enough?
 

amitrandive

Well-Known Member
Thanks. I don't have a programming background and hence didn't want to tinker with the formula.

Anyway, after realizing that we can save our custom formulae separately, have made the following change using some guesswork / trial-error. Grateful if anyone with programming experience can confirm this is correct (I checked how this behaves on the chart after the edit, yet would like to confirm)





All that I have done is:
1/ Added the line "range 1 =........" (in red) to the original code; and
2/ Changed "range" to "range1" in the Plot(PDI) and Plot(MDI) lines.

Good enough?
Did you try it ?If it worked good enough
 

mastermind007

Well-Known Member
Thanks. I don't have a programming background and hence didn't want to tinker with the formula.

Anyway, after realizing that we can save our custom formulae separately, have made the following change using some guesswork / trial-error. Grateful if anyone with programming experience can confirm this is correct (I checked how this behaves on the chart after the edit, yet would like to confirm)





All that I have done is:
1/ Added the line "range 1 =........" (in red) to the original code; and
2/ Changed "range" to "range1" in the Plot(PDI) and Plot(MDI) lines.

Good enough?

Yes, that looks correct. You've separated range variable of ADX from range variable of PDI and MDI
 
I want the stock in nr7 EOD and strategy recently developed by 5 min setup should be clubbed
_SECTION_BEGIN("NR7");

/*********** NR7 System for Chart and Exploration ***********************/

R = H - L;
NR7 = False;
NR4 = False;
m7 = m4 = idm7 = idm4 = idm = 0;

for(i = 7; i < BarCount; i++)
{
if( R < R[i - 1] AND R < R[i -2] AND R < R[i - 3] AND R < R[i - 4] AND R < R[i - 5] AND R < R[i - 6])
{
NR7 = True;
m7 = 1;
}
}

for(i = 4; i < BarCount; i++)
{
if((R < R[i - 1] AND R < R[i -2] AND R < R[i - 3] ) AND NOT NR7)
{
NR4 = True;
m4 = 1;
}
}
IDNR7 = Inside() * NR7;
IDNR4 = Inside() * NR4;
ID = Inside();
idm7 = IIf(IDNR7, 1, 0);
idm4 = IIf(IDNR4, 1, 0);
idm = IIf(id, 1, 0);

for(i = 1; i < BarCount; i++)
{
if(IDNR7 == IDNR7[i - 1]) idm7 = idm7 + idm7[i - 1];
if(IDNR4 == IDNR4[i - 1]) idm4 = idm4 + idm4[i - 1];
if(NR7 == NR7[i - 1]) m7 = m7 + m7[i - 1];
if(NR4 == NR4[i - 1]) m4 = m4 + m4[i - 1];
if(ID == ID[i - 1]) idm = idm + idm[i - 1];
}

MarkerIDNR7 = MarkerIDNR4 = shapeStar ;

Marker7 = shapeDigit7;
NR7Color = colorBrightGreen;

Marker4 = shapeDigit4;
NR4Color = colorLightOrange;

MarkerID = shapeHollowCircle;
IDColor = colorYellow;

IDNR7Color = colorBrightGreen;
IDNR4Color = colorLightOrange;

MarkerDist = L * 0.995;
IDNRDist = H * 1.03;

if(Status("action") == actionIndicator)
{
_N(Title = StrFormat("{{NAME}}, {{DATE}} ({{INTERVAL}}): {{VALUES}}") + ", Range=" + Prec(R + 0.00001, 2) + ","
+ WriteIf(IDNR7, EncodeColor(colorBrightGreen) + WriteIf(idm7 > 1, StrLeft(NumToStr(idm7), 4), "") + " IDNR7 ", "")
+ WriteIf(IDNR4, EncodeColor(colorLightOrange) + WriteIf(idm4 > 1, StrLeft(NumToStr(idm4), 4), "") + " IDNR4 ", "")
+ WriteIf(NR7 AND NOT ID, EncodeColor(colorBrightGreen) + WriteIf(m7 > 1, StrLeft(NumToStr(m7), 4), "") + " NR7 ", "")
+ WriteIf(NR4 AND NOT ID, EncodeColor(colorLightOrange) + WriteIf(m4 > 1, StrLeft(NumToStr(m4), 4), "") + " NR4 ", "")
+ WriteIf(ID AND NOT NR7 AND NOT NR4, EncodeColor(colorTurquoise) + WriteIf(idm > 1, StrLeft(NumToStr(idm), 4), "") + " Inside Day ", ""));

PlotOHLC(O, H, L, C, "Close", colorLightGrey, styleBar);
PlotShapes(IIf(IDNR7, MarkerIDNR7, shapeNone), IDNR7Color, 0, IDNRDist);
PlotShapes(IIf(IDNR4 AND NOT IDNR7, MarkerIDNR4, shapeNone), IDNR4Color, 0, IDNRDist);
PlotShapes(IIf(NR7 AND NOT ID, Marker7, shapeNone), NR7Color, 0, MarkerDist);
PlotShapes(IIf(NR4 AND NOT NR7 AND NOT ID, Marker4, shapeNone), NR4Color, 0, MarkerDist);
PlotShapes(IIf(ID AND NOT NR7 AND NOT NR4, MarkerID, shapeNone), IDColor, 0, IDNRDist);
}

if(Status("action") == actionExplore)
{
Filter = (m7 > 0) OR (m4 > 0) OR (idm > 0);

SetOption("NoDefaultColumns", True);

AddColumn(DateTime(), "DATE", formatDateTime, colorDefault, colorDefault, 96);
AddTextColumn(Name(), "SYMBOL", 77, colorDefault, colorDefault, 120);
AddColumn(R, "Range", 6.2, colorDefault, colorDefault, 84);
AddColumn(IIf(idm, 48 + idm, 32), "INSIDE", formatChar, colorYellow, IIf(idm, colorLightBlue, colorDefault));
AddColumn(IIf(m4, 48 + m4, 32), "NR4", formatChar, colorYellow, IIf(m4, colorBlue, colorDefault));
AddColumn(IIf(m7, 48 + m7, 32), "NR7", formatChar, colorYellow, IIf(m7, colorGreen, colorDefault));
}

/************************** END OF AFL CODE *****************************/

_SECTION_END();



/*********************************************/

Those stocks in nr7 filtered and apply this afl as a scanner to buy
 
I want to create an amibroker AFL code as per the below requirements.

1. The rectangle should automatically extend to the right side when drawn on the chart.

2. The rectangle should display the price values on the upper and lower line of the rectangle [Right Side extend].

3. The color of the rectangle should be auto set to Red if it drawn above the LTP and should be set to Green if it is drawn below LTP.
 
hello senior traders
i need help regarding amibroker. My amibroker was crashed and when i downloaded new version or even old one also with crack , it shows lenience errors. kindly give me ami with crack which saves data. thanks in advance.
 

Similar threads