[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 252

 
kon12:

Dear Professionals, could you advise... I'm using line drawing in the indicator:

The problem is that when I switch to another timeframe the lines are drawn according to the new parameters, but the old ones are not deleted. What should I add and where should I put it so that when I move to another timeframe the old lines are not drawn? Thanks...
You need to set deinit to delete old lines.
 

Tell me what's wrong:

double order=AccountEquity()/4100;

...

ticket=OrderSend(Symbol(),OP_BUY,NormalizeDouble(order,2),Ask,10,Ask-SL*10*Point,Ask+SL*20*Point, "buy_order",1,0,Green);


it gives out: 2011.03.08 16:35 ScaplerM5 EURUSD,M5: OrderSend error 4051
2011.03.08 16:35 ScaplerM5 EURUSD,M5: invalid amount for OrderSend function

 
AndrejFX:

Tell me what's wrong:

double order=AccountEquity()/4100;

...

ticket=OrderSend(Symbol(),OP_BUY,NormalizeDouble(order,2),Ask,10,Ask-SL*10*Point,Ask+SL*20*Point, "buy_order",1,0,Green);


it gives out: 2011.03.08 16:35 ScaplerM5 EURUSD,M5: OrderSend error 4051
2011.03.08 16:35 ScaplerM5 EURUSD,M5: invalid lots amount for OrderSend function

Probably, the lot size is smaller than allowed.

I.e., if the minimum allowable lot is 0.1, but your lot = 0.09....

 

Good evening all!

Can you please tell me if TimeCurrent(); - returns the last known server time, the time of the last quote, or the last arrival of any instrument?

According to my experimental data, it's the second one.

I just want someone to confirm it!

Thanks in advance for the reply!

 
BBSL:

Good evening all!

Can you please tell me if TimeCurrent(); - returns the last known server time, the time of the last quote, or the last arrival of any instrument?

According to my experimental data, it's the second one...

I just want someone to confirm it!

Thanks in advance for the reply!

Actually, it's the current server time.... which was received last...
 
coronel:
Actually, it's the current server time.... which was received last...

So, not the time of the last quote for a given currency pair?
 
BBSL:

According to my experimental data, the second...

Yeah.

That's what it says in the help - "last server time". It's not tied to a specific currency.

 
sergeev:

Yes.



So... So I had a question...

I have a need in init(e) to use a function that collects ticks for the current currency...

I've solved it like this -

double init_array[10];


int init (){

int count = 0;
int time = 0;
int size = ArraySize(init_array); 


time = TimeCurrent();

while (count != size){

if (time != TimeCurrent()){

time = TimeCurrent();

init_array [count] = Ask; 

count = count + 1;

}

}


}

But, if you pay attention to the code and my question, I have a lot of values that will stupidly repeat...

What to do, how to make Expert Advisor react only on new tick arrival for a given instrument.

I have an idea to compare i and i+1, but if two equal ones arrive in a row, we will lose one of the values.

Please assist))

 
BBSL:

What to do, how to make the EA react only to a new tick coming for the given symbol?

remove while

move the code to start

and parameters

int count = 0;
int time = 0;

outside

 
sergeev:
remove while


Yes, you can, but in case expert is multicurrency, it won't solve the problem, right?

Still, can we solve this trabble in the inite?)