New Scripter Question :) Help pls :)

 
Hi,

I am new to writing scripts on MQL4 and have met some problem can someone help me pls :)

1) I tried assigning Ask to a variable example named Checkprice,
what i want is that moment Ask price into the variable only,
but it ended up tying Ask into Checkprice.
example:

if(Ask>Checkprice)
{
Checkprice=Ask;
return(0);
}

-------------------------------------

is there some syntax I must use to capture the ask price instead?

Thanks in advance
Zephery
Newbie Trader :)
 

"what i want is that moment Ask price into the variable only"

Well, i don't see anything wrong there. You got it.

If Ask is greater than CheckPrice then assign the current Ask price to the variable CheckPrice and exit.


"but it ended up tying Ask into Checkprice"

I have no clue what you are trying to say here.

 
phy:

"what i want is that moment Ask price into the variable only"

Well, i don't see anything wrong there. You got it.

If Ask is greater than CheckPrice then assign the current Ask price to the variable CheckPrice and exit.


"but it ended up tying Ask into Checkprice"

I have no clue what you are trying to say here.

Thanx For replyinging,

What i mean is when ever there is a price change,
the variable value change together with Ask.
but i only want the variable to change only when it is smaller then ask.

Sorry for the bad expression of word.
 

"What i mean is when ever there is a price change,
the variable value change together with Ask.
but i only want the variable to change only when it is smaller then ask."

That is what the code you wrote is doing.

if(Ask>Checkprice) Checkprice=Ask;

Reason: