Simple Coding Help - No Promise.

amitrandive

Well-Known Member
Hello Amit ... It was actually located in previous afl both on top & @ end . might be need to write same formula 2 times & to shift 2nd parameters as fit to end ...

Hello amibroker formula Experts ... I need this afl to get all lines drawn on open @ least 5 dots advanced to get proper reading of open high low close as when market opens on very first bar i am unable to view the single dot for each parameter .
Cellclinic

You have found the solution, I think you can now do that yourself.
:thumb:
 
I think it would be very easy for you to do please help me,


Thank you all for your hard work, Amibrocer code for ndx is different than the metatrader version,
what's the problem ?,
I guess the problem could tema in amibroker. please help me and , do fix it. Thank you

//metatrader code for ocean ndx
.
.
.

for(i = limit; i >= 0; i--)

{
double SumWght = 0, SumDnom = 0, DifAry, DnomAry, FracAry, TimeAry, WgtAry;
for(ii = 1; ii <= NDX_period; ii++)
{
DifAry = MathLog(Close[i+ii-1]) - MathLog(Close[i+ii]);
if(ii == 1) DnomAry = MathAbs(DifAry); else DnomAry += MathAbs(DifAry);
if(DnomAry == 0) FracAry = 0; else FracAry = (MathLog(Close) - MathLog(Close[i+ii])) / DnomAry;
TimeAry = 1 / MathPow(ii, 0.5);
WgtAry = FracAry * TimeAry;
SumWght += WgtAry;
SumDnom += TimeAry;
}
RawNDX = 100 * SumWght / SumDnom;
}
double ExpSmooth = 2, XAvg1, XAvg2, XAvg3;
ExpSmooth = ExpSmooth / (SmLen + 1);
for(i = bars - NDX_period - 1; i >= 0; i--)
{
XAvg1 += ExpSmooth * (RawNDX - XAvg1);
XAvg2 += ExpSmooth * (XAvg1 - XAvg2);
XAvg3 += ExpSmooth * (XAvg2 - XAvg3);
maNDX = 3 * XAvg1 - 3 * XAvg2 + XAvg3;
if(i < bars - NDX_period - 1 - 3*SmLen)
{
if(maNDX > 90) NDX = MathRound(90 + (maNDX - 90) / 2);
else if(maNDX < -90) NDX = MathRound(-90 - (MathAbs(maNDX) - 90) / 2);
else NDX = MathRound(maNDX);
}
}
.
.
.

//amibrocer code for ocean ndx

NDX_period = Param("NDX Period",75,40,375);
NDX_SmLen = round(NDX_Period*20/40);


SumWght = 0;
SumDnom = 0;

for(i = 1; i < NDX_period+1; i++)
{
DifAry = ln(Ref(Close,-i+1)) - ln(Ref(Close,-i));
if(i == 1)
DnomAry = abs(DifAry);
else
DnomAry =DNomAry+ abs(DifAry);
FracAry =IIf(DNomAry==0, 0,(ln(Close) - ln(Ref(Close,-i))) / DnomAry);
TimeAry = 1 / (i^( 0.5));
WghtAry = FracAry * TimeAry;
SumWght =SumWght+ WghtAry;
SumDnom =SumDnom+ TimeAry;
}
RawNDX = 100 * SumWght / SumDnom;

TemaNDX= TEMA(RawNDX,NDX_SmLen);

Plot(TemaNDX,"NDX",colorRed,styleLine);


please, i need it , thanks !!
 
// 5 minute rules.

TimeFrameSet(in5Minute);
m = L<=BBandBot(C,200,2) AND Ref(L,-1)>Ref(BBandBot(C,200,2),-1);
n = H>=BBandBot(C,200,2) AND Ref(H,-1)<Ref(BBandBot(C,200,2),-1);
TimeFrameRestore();

Bu = m ;
Se = n ;

Filter = Bu OR Se;

AddColumn(DateTime(),"Date/time",formatDateTime);
AddColumn(Bu,"Support Entry",colorBlack,1.2);
AddColumn(Se, "Resistance sell",colorBlack,1.2);

-----------XXX----------------

I have written this AFL scanner to scan for stocks that have touched Bollingar band Extreme on 5 minute chart.

While saving the scanner formula no error shows up but when I scan for stocks , no stock shows up.

Kindly guide where am I doing It wrong.
Assistance needed at earliest.

P.S: Bollingar Band setting is Ema = 200 and standard deviation = 2.
 

amitrandive

Well-Known Member
please, i need it , thanks !!
// 5 minute rules.

TimeFrameSet(in5Minute);
m = L<=BBandBot(C,200,2) AND Ref(L,-1)>Ref(BBandBot(C,200,2),-1);
n = H>=BBandBot(C,200,2) AND Ref(H,-1)<Ref(BBandBot(C,200,2),-1);
TimeFrameRestore();

Bu = m ;
Se = n ;

Filter = Bu OR Se;

AddColumn(DateTime(),"Date/time",formatDateTime);
AddColumn(Bu,"Support Entry",colorBlack,1.2);
AddColumn(Se, "Resistance sell",colorBlack,1.2);

-----------XXX----------------

I have written this AFL scanner to scan for stocks that have touched Bollingar band Extreme on 5 minute chart.

While saving the scanner formula no error shows up but when I scan for stocks , no stock shows up.

Kindly guide where am I doing It wrong.
Assistance needed at earliest.

P.S: Bollingar Band setting is Ema = 200 and standard deviation = 2.
One earnest request ,stop making demands and start making requests.
Also these issues are posted on multiple threads.
If there is no resolution , within your strict Time schedule , it may mean many things like ,
Seniors are busy
There is no solution
Etc , etc ,etc
 
TimeFrameSet(in5Minute);
m = L<=BBandBot(C,200,2) AND Ref(L,-1)>Ref(BBandBot(C,200,2),-1);
n = H>=BBandTop(C,200,2) AND Ref(H,-1)<Ref(BBandTop(C,200,2),-1);
TimeFrameRestore();

Bu = m ;
Se = n ;
Buy=Bu;
Sell=Se;
Filter =Buy OR Sell;

AddColumn(DateTime(),"Date/time",formatDateTime);
AddColumn(Bu,"Support Entry",colorBlack,1.2);
AddColumn(Se, "Resistance sell",colorBlack,1.2);


Now see it will work

Maruti Mane
 
Last edited:
TimeFrameSet(in5Minute);
m = L<=BBandBot(C,200,2) AND Ref(L,-1)>Ref(BBandBot(C,200,2),-1);
n = H>=BBandTop(C,200,2) AND Ref(H,-1)<Ref(BBandTop(C,200,2),-1);
TimeFrameRestore();

Bu = m ;
Se = n ;
Buy=Bu;
Sell=Se;
Filter =Buy OR Sell;

AddColumn(DateTime(),"Date/time",formatDateTime);
AddColumn(Bu,"Support Entry",colorBlack,1.2);
AddColumn(Se, "Resistance sell",colorBlack,1.2);


Now see it will work

Dear Logitec,

I have made some modification for support and ressistance, Now it will work perfectly to show support and resistance.

Maruti Mane
 
One earnest request ,stop making demands and start making requests.
Also these issues are posted on multiple threads.
If there is no resolution , within your strict Time schedule , it may mean many things like ,
Seniors are busy
There is no solution
Etc , etc ,etc

Thank You for the reply,
I have tried my self around but couldn't get hold on solution for the problem,
If you could guide me towards a solution, I would be thankful.
 
TimeFrameSet(in5Minute);
m = L<=BBandBot(C,200,2) AND Ref(L,-1)>Ref(BBandBot(C,200,2),-1);
n = H>=BBandTop(C,200,2) AND Ref(H,-1)<Ref(BBandTop(C,200,2),-1);
TimeFrameRestore();

Bu = m ;
Se = n ;
Buy=Bu;
Sell=Se;
Filter =Buy OR Sell;

AddColumn(DateTime(),"Date/time",formatDateTime);
AddColumn(Bu,"Support Entry",colorBlack,1.2);
AddColumn(Se, "Resistance sell",colorBlack,1.2);


Now see it will work

Dear Logitec,

I have made some modification for support and ressistance, Now it will work perfectly to show support and resistance.

Maruti Mane
Hey Maruti Thanks for the help But the problem still persists, even after doing the changes nothing shows up on scanner.

I don't know where I am going wrong!
 
TimeFrameSet(in5Minute);
m = L<=BBandBot(C,200,2) AND Ref(L,-1)>Ref(BBandBot(C,200,2),-1);
n = H>=BBandTop(C,200,2) AND Ref(H,-1)<Ref(BBandTop(C,200,2),-1);
TimeFrameRestore();

Bu = m ;
Se = n ;
Buy=Bu;
Sell=Se;
Filter =Buy OR Sell;

AddColumn(DateTime(),"Date/time",formatDateTime);
AddColumn(Bu,"Support Entry",colorBlack,1.2);
AddColumn(Se, "Resistance sell",colorBlack,1.2);

It is working fine in my PC my ami is 5.60;
Please repaist the AFL in formula editor and then pick for the analysis
It should work, there is no any problem.
otherwise go to filter col. in AA window and choose market255 it will work.

Maruti Mane
 

Similar threads