Need some help here ... i just started learning this ....

 

hi all,

need some help here ... am trying to make a script that can check the moving average value.

so far i have that done but its just that the value does not refresh.

so i was trying to loop the thing so that it will be refresh.

i tried using a while loop but it seems that the refreshing is too fast and the value started flicking and my CPU usage is almost 100%.

i tried searching the forums and seen some examples and none of them uses while loop to loop thru the script.

tried them but all fails, plus i realised that the value of the moving average will only change when a new bar appears.

so this is what i tried but fail ... could someone enlighten me on this???

void start()

{

if(Volume[0]>1) return;

/*body of program*/

}

is this correct?

 
8879899714:

hi all,

need some help here ... am trying to make a script that can check the moving average value.

so far i have that done but its just that the value does not refresh.

so i was trying to loop the thing so that it will be refresh.

i tried using a while loop but it seems that the refreshing is too fast and the value started flicking and my CPU usage is almost 100%.

i tried searching the forums and seen some examples and none of them uses while loop to loop thru the script.

tried them but all fails, plus i realised that the value of the moving average will only change when a new bar appears.

so this is what i tried but fail ... could someone enlighten me on this???

void start()

{

if(Volume[0]>1) return;

/*body of program*/

}

is this correct?

Write an EA, and use Alert function, when your MAs cross.

 
c0d3 wrote >>

Write an EA, and use Alert function, when your MAs cross.

ok, thanks ... that sort of help. :)

 
8879899714 wrote >>

ok, thanks ... that sort of help. :)

We are not clear whether you have used a Script (used for a single action or list of actions)

Or your script (i.e. code) is in an Expert Adviser.

The current value of the Moving Average will be changing as the curent price moves

If you need a fixed value check it (with a Shift of 1) on the first tick of the new bar

Good Luck

-BB-

Reason: