iCustom MT4

tmazanec

Newbie
Messages
3
Likes
0
Question regarding MT4:

I have built a custom indicator: "Y"

within the code Y = ( (S - e575) );

I would now like to find the moving average of Y, much like %D to %K in stochastics. I've tried:

DSI = iMA("Y",0,72,1,MODE_SMA,PRICE_CLOSE,0);
DSI = iCustom (NULL,0,"Y",0,1,0);

Neither works. To me this seems to be a simple request as I'm just looking for the 6 hour moving average of Y to be a crossover.

Any help would be appreciated. Please answer w/ the exact code as I am a trader and not a code writer thus telling me to 'loop' is of no assistance.

Thanks,
 
I believe that I figured it out using:

SignalBuffer=iMAOnArray(MainBuffer,72,DPeriod,0,MODE_SMA,i);

You can make MainBuffer = anything that you want so this should suffice.
 
Question regarding MT4:

I have built a custom indicator: "Y"

within the code Y = ( (S - e575) );

I would now like to find the moving average of Y, much like %D to %K in stochastics. I've tried:

DSI = iMA("Y",0,72,1,MODE_SMA,PRICE_CLOSE,0);
DSI = iCustom (NULL,0,"Y",0,1,0);

Neither works. To me this seems to be a simple request as I'm just looking for the 6 hour moving average of Y to be a crossover.

Any help would be appreciated. Please answer w/ the exact code as I am a trader and not a code writer thus telling me to 'loop' is of no assistance.

Thanks,

The best way I have found to do this is:

//fill in the results for the all bars with the Y indicator into a non
// display buffer
for( int i = 0; i < (Bars - ExtCountedBars); i++)
{
dYBuffer = iCustom(SymbolName(),0,"Y", Param1, Param2...);
}

//Put the AVERAGE of the Y results into the display buffer
for( i = 0; i < (Bars - ExtCountedBars); i++)
{
dDisplayBuffer = iMAOnArray(dYBuffer,0,Smoothing,0,SmoothingType,i);
}
 
Top