[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 487

 
tol64:


)))) No, I think it would be better to leave the magician. And just leave the pending orders.

To be more precise, leave the magic symbols that are needed. And if you use several EAs on different charts, you should also include symbols in the check. I have not come to this point yet. ))


Usually we check a symbol and a magik - a symbol to use on different instruments, not to change a magik - and a magik to use on one instrument and different timeframes - but only a magik can be checked, if it is output in external variables
 
Can you tell me if the broker jmt:0 is the same colour in summer and winter?
 
FOReignEXchange:

I never use magicians at all. Although sometimes there are a few items at a time. I use tickets. It's much easier to check through OrderSelect. And the function OrderSend becomes clearer. Well, everyone is the master of his own handwriting. Personally, I have never had any problems without magicians.

The ticket never goes anywhere. It's convenient.

Exactly... :) Close a partially open position. And then try to change the stop or take by the ticket you have for this position. Then you'll get the best of both worlds. :)

Example: We have an open position with 1.0 lot, and ticket #1. You need to close 0.5 lots of this position and keep the remaining 0.5 lots.

Actions of the Dealer Center:

1. Close position #1 by full volume (lot 1.0) 2.

2) Open position #2 with 0.5 lot volume

To you it looks like a partial closing of position #1 and leaving the rest of it in the market. Only the ticket of this position is not what you think it is...

 
FOReignEXchange:


I don't get it? I'm just looking in the help, there OrderSelect() uses a condition. And I haven't seen anywhere without true.

If is a condition operator. And there should be a condition in brackets. It seems more logical to me this way. Although there may be no difference.

Let's draw an analogy with Russian. IMHO - it is more convenient to read the code mentally replacing its operators with spoken text:

if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;

What we have here is:

If the order hasn't beenchosen, we interrupt the loop.

Now:

if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break;

It's more convenient here:

ifno order has been selected, we interrupt the loop.

The same thing is absolutely the same, but it is easier to read. And there is less writing...

And we can also remove all unnecessary things and get even less code:

if(!OrderSelect(i,SELECT_BY_POS)) break;

Why? Because we select a market order and it is MODE_TRADES by default, so we can omit it in the OrderSelect() function parameter...

Oh, yeah... :)

 
artmedia70:

Oh dear... :)


)))

Okay. It's morning, so good morning! ))

I have yet another anomaly that I don't understand at first glance. The simplest operation:

double High_1  = NormalizeDouble(iHigh(Symbol(),Timeframe,1),Digits);
double new_val = NormalizeDouble(High_1 + PlsMns_point*Point,Digits);

I can see in the journal:

And literally in a mirror image:

 double Low_1   = NormalizeDouble(iLow(Symbol(),Timeframe,1),Digits);
 double new_val = NormalizeDouble(Low_1 - PlsMns_point*Point,Digits);

In the journal I see this "figure":

The external variablePlsMns_point is of type int. It is passed into a function. What should I do to eliminate this misunderstanding? ))

 

The external variable PlsMns_point is of type int .

From the first log entry, it appears to be of type Double, int being an integer.

 
Stells:

The external variable PlsMns_point is of type int .

According to the first log entry it is of type Double, int is an integer.


And when multiplied by Point, the conversion seems to happen. But this is not the problem, since I tried double as well.

P.S. And besides two identical variants. The only difference is in mirroring. Why so?

 

I think you have this value missing:

double Low_1 = NormalizeDouble(iLow(Symbol(),Timeframe,1),Digits);

maybe download the history

 
tol64:


)))

Okay. It's morning, so good morning! ))

I have yet another anomaly that I don't understand at first glance. The simplest operation:

I can see in the journal:

And literally in a mirror image:

In the journal I see this "figure":

The external variablePlsMns_point is of type int. It is passed into a function. What should be done to eliminate this misunderstanding? ))

Print the values of High_1 and Low_1 variables as well. In general, print out the values passed to the function, and print out the return values, too. Then you will see where to start from. Often the variables you are sure of take absolutely unexpected values. That is when you will find the mistake.
 

Good day, how can I change the volume of log file (adjust, clear), which is sometimes clogged to huge values due to EA errors. I need a way to do this by the Expert Advisor itself.

Reason: