Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 109

 
borilunad:
Try n do double! It won't hurt, but it may help to solve the problem.

I have n written in arrays there as well. So it won't work, I tried it and got an error.
 
artmedia70:

Is this from a textbook?

You have to overrun the orders like this:

Accordingly, the rest of the arrays will float...

I would search for the last closed order by trying to search through history, not by explicitly pointing to 1

And so on ... I can't search any further - first, it would hardly help me without code integrity, and second, it's 7 a.m. and I haven't even gone to bed yet...

Where do you live, Artyom? Siberia?
 
webip:

I have n written in arrays as well. So it won't work, I tried it and got an error.
So, to find the error yourself, print all the values you get. Then look in the log where the price is lost
 
artmedia70:

Array

what type do you have?

What type are price, tp, take variables? Why should we guess here?



Why should we guess? At the beginning of the function everything is declared as type double. take a look at .
 
borilunad:
Where do you live, Artyom? Siberia?
I'm a Siberian, yeah. Near Krasnoyarsk.
 
webip:

Why guess? At the beginning of the function everything is declared as type double. take a look at .
What type does the array have?

Right there:

ticket=mas_ord[n][1];
    if(mas_ord[n][4]!=tip)
     continue;
    price=mas_ord[n][6];
    tp=mas_ord[n][2];   

Your ticket is int, the rest is double. You read them from the array - what type is the array?


 
artmedia70:
What type of array is it?


also double
 
webip:

I have n written in arrays as well. So it won't work, I tried it and got an error.
Then for this case make a double: double N = n; and here use N, and the arrays remain int n!
 
webip:

also double
And where in this function do you read the StopLoss of the last closed? There's nothing there.
 
Go to sleep, everyone! It's always better in the morning! It's 1:00 in the morning! Good night! And Artyom has already slept in!