[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 344

 
Vinin >> :

Variables. I asked to give either arrays or variables different names. But they didn't seem to understand me.

I haven't understood it till now. >> Please explain.

 

The logic of the indicator is clear to me. I can't write it in code yet, as I have little knowledge and experience in programming.

I have understood the limitation of the number of bars in the calculation. I will take it into account, thanks.

 

Please advise how to deal with error 4054. It keeps popping up in the indicator when iTime() is accessed after a character change.

Thank you.

 
Laven писал(а) >>

I still don't get it. Please explain.

If they are arrays, there will be holes in them and expressions like:X[i]=Z[i]+X[i+1] are meaningless.

If they are variables, it's very simple:

for(i=0;i<ArraySize[z];i++)

if(Z[i]>=0)X+=Z[i];

else Y+=Z[i];

 
Silen писал(а) >>

Please advise how to deal with error 4054.

Correctly write the code.

 
Roger >> :

Correctly write the code.

First of all, learn how to answer on the merits. Comments like yours are of no use to anyone.

 
Silen писал(а) >>

First and foremost, learn to answer substantively. Comments like yours are of no use to anyone.

Well, if my answer is not substantive, let's wait to see who can give you an answer on your scant information.

 
please advise how to find out the profit of the last and penultimate closed order, is it realistic? thank you
 
Silen писал(а) >>

First of all, learn to answer correctly. Nobody needs comments like yours.

Roger >>:

Well, if my answer is not on point, let's wait to see who can give you an answer on your scarce information

.

Break!!!


Silen, did GetLastError return the 4054 error to you or did you see it in the logs? Please also give me a piece of code where the error is coming out

 
vik-777 >> :
Please, advise how to know the profit of the last and penultimate closed order, is it real?

OrderSelect (0,SELECT_BY_POS, MODE_HISTORY) - selects the last order in the history

OrderSelect (1,SELECT_BY_POS, MODE_HISTORY) - the last but one order

respectively, for each of them you can find OrderProfit()

Reason: