Johnyparwwkh sir plz look in to StepMA

KelvinHand

Well-Known Member
#11
This is created by Karthik marar sir...don't know whether it will help u or not...

HTML:
//Step MA Based on the Popular MetaTrader Indicator
//Version V.1.0 dated 18-07-2012
//Coded by Karthik Marar
//Copyright www.tatechnics.in
//======================== Indicator============================

_SECTION_BEGIN("StepMA");	
Kv			   = Param("Sensitivity", 1.25,0.1,2,0.1); 
PeriodWATR	   = Param("PeriodWATR",14,1,100,1);

AvgRange[0]=0;
	for (i=PeriodWATR-1;i>=0;i--)
	    { 
       dK = 1+1.0*(PeriodWATR-i)/PeriodWATR;
       AvgRange=AvgRange+ dK*abs(High[i]-Low[i]);
       }
	WATR = AvgRange/PeriodWATR;

StepSize=Kv*WATR;
smax  = Low+2*StepSize;
smin  = High-2*StepSize;
	
trend[0] 		= 1;
Linebuffer[0] = C[0];
Linemax[0]  = C[0];
Linemin[0]  = C[0];
Linemid[0]  = C[0];
for(i = PeriodWatr; i < BarCount; i++)	  
{
if(Close[i]>smax[i-1]) trend[i]=1; 
else
{
if(Close[i]<smin[i-1]) trend[i]=-1;
else
trend[i] = trend[i-1];
}
//--------------------
if(trend[i] > 0 AND smin[i]<smin[i-1]) smin[i]=smin[i-1];
if(trend[i] < 0 AND smax[i]>smax[i-1]) smax[i]=smax[i-1];
		
if (trend[i] >0 ) LineBuffer[i]=smin[i]+StepSize[i];
else
{
if (trend[i] <0) LineBuffer[i]=smax[i]-StepSize[i];
else
LineBuffer[i] = LineBuffer[i-1];
}
	
}

Plot (lineBuffer,"",colorYellow,1);
Plot (C,"StepMA V.1.0",IIf(C>Linebuffer,colorLime,colorRed),styleBar);
_SECTION_END();

_SECTION_BEGIN("Name");
GfxSetOverlayMode(1);
GfxSetTextColor( ColorHSB( 82, 82, 82 ) );
GfxSetBkMode(0); 
GfxSelectFont("Tahoma", Status("pxheight")/12 );
GfxTextOut( "StepMA", Status("pxwidth")/2, Status("pxheight")/3 );
GfxSelectFont("Tahoma", Status("pxheight")/36 );
GfxTextOut( "www.Tatechnics.in", Status("pxwidth")/2, Status("pxheight")/2 );
_SECTION_END();_SECTION_END();
Enjoy...
This code is not properly coded.
You will see the instability OR so called repaint when used.
 

KelvinHand

Well-Known Member
#12
actually it is lot different then the mt4 code i have posted here.
so plz Johny sir.....
when can we see StepMA V7.0 in afl form.
In my calculation, johnny is going to take longer time to come out the code, can be week to month...:
1st - Need to convert the 2 MT functions to AFL functions
2nd - Reverse the looping and related
3rd .. This is the critical, retain the MT4 variable.
 
Last edited:

johnnypareek

Well-Known Member
#13
In my calculation, johnny is going to take longer time to come out the code, can be week to month...:
1st - Need to convert the 2 MT functions to AFL functions
2nd - Reverse the looping and related
3rd .. This is the critical, retain the MT4 variable.
That is very true . but normal guy can't understand this. It's not their fault. It's better to be late even very late then wrong. May be I am wrong. Though I have come up with solution of thses kinda in past, but, rather then wrong its better to be late.
 

KelvinHand

Well-Known Member
#14
That is very true . but normal guy can't understand this. It's not their fault. It's better to be late even very late then wrong. May be I am wrong. Though I have come up with solution of thses kinda in past, but, rather then wrong its better to be late.
That the idea of explaining to the normal guy.
Otherwise, they will keep reminding you and without concerning the complexity and ability.

By the way, had you figure out the solution ?
 

extremist

Well-Known Member
#18
i'm in no hurry ....! Johny sir......
i just started this thread coz i thought it just slipped out of ur mind.

even i'm trying to code it.
but i'm so helpless to understand the syntax of mt4.

it took me almost 6-7 months to learn afl.
now i don't know how much it will take me for mt4.....

it was nice of u tht u and kelvinhand at least now declared tht it's gonna take time for u....

so waiting ......
and trying.........
 

KelvinHand

Well-Known Member
#19
i'm in no hurry ....! Johny sir......
i just started this thread coz i thought it just slipped out of ur mind.

even i'm trying to code it.
but i'm so helpless to understand the syntax of mt4.

it took me almost 6-7 months to learn afl.
now i don't know how much it will take me for mt4.....

it was nice of u tht u and kelvinhand at least now declared tht it's gonna take time for u....

so waiting ......
and trying.........
If you can code, then do it yourself.
I had laid out the code structure in Post #12.
Should be able to done it in 2-5days or even less with guide
 
Last edited:

Similar threads