New & This (GetQuotes)

 

I was looking for a function where I can get the current quote rate, but was unable to find it . I found point while searching for it, but I don't think I understand the full functionality of point as of yet, so I need some clarification. I am going to try my best with coding examples of what I am trying to do in mt4, keep in mind I am not a great programmer, this is just to try and paint the picture. What I want to do is below. For any clarification, just ask away, and I will try my best to explain via words or any means I can.

function(double n)

{

double level = 0.0000;

double newLevel;

if (ema1>ema2){

quote = level;

level = newLevel;

}

return newLevel;

}

 
thoughtful:

I was looking for a function where I can get the current quote rate, but was unable to find it . I found point while searching for it, but I don't think I understand the full functionality of point as of yet, so I need some clarification. I am going to try my best with coding examples of what I am trying to do in mt4, keep in mind I am not a great programmer, this is just to try and paint the picture. What I want to do is below. For any clarification, just ask away, and I will try my best to explain via words or any means I can.

Please use this to post code . . . it makes it easier to read.

Do you mean Bid ?

 

I will use SRC from now on, I thought it wouldn't be difficult to read with me editing the colors of the text, so my apologies.

Is this bid, that I am looking for?

Can I have a variable and have the value of bid at that moment transfer to that variable?

example....

double level = 0.0000;

if(ema1==ema2){
RefreshRates();
Bid = level;
}

Is it as simple as this, or do I have to use point?

 
thoughtful:

I will use SRC from now on, I thought it wouldn't be difficult to read with me editing the colors of the text, so my apologies.

Is this bid, that I am looking for?

Can I have a variable and have the value of bid at that moment transfer to that variable?

example....

Is it as simple as this, or do I have to use point and refresh rates?

Bid is the current Bid price, you can't set Bid, you read it to get the current price.

Also, if you want a function to return a double variable you have to declare the function as type double.

I'm not 100% clear on what you are trying to do . . . I assumed by "quote rate" you meant current price ? can you explain some more please ?
 

Oops, you're right I can't set bid lol, so let me re-type the code.

double level = 0.0000;

if(ema1==ema2){
RefreshRates();
level = Bid;
}

In words,

If/When ema1 is equal to ema2 then the variable, level, will be the value of the price the moment those emas crossed. Thank you for trying to help me with this, and I appreciate your quick responses as well. If I am still unclear, then let me know, and I will try again and again.

 
double level;

if((ema1>=ema2)||(ema1<=ema2)){level=Bid;}

Why would you like to record price values at ema crossings?

Thank you.


Oops, actually you will need to write it like, if ema1 (shift 2) > ema2 (shift 2), then ema1 (shift 1) < ema2 (shift 1).

You will need to create a separate block of code for the "if ema1=ema2".

Apologies for the mistake. It should be rectified now.

double level;

if((ema1(shift2)>ema2(shift2))&&(ema1(shift1)<ema2(shift1))){level=Bid;}

if(ema1==ema2){level=Bid;}
 
I am trying to build an EA that can hold price changes in a variable, which can alert me when certain conditions are met, and thank you for clarifying what I had trouble with.
 

Yeah, np. Glad to be of assistance.

Thank you.

Reason: