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

 
sergeev >> :
do you want a looped script?

>> in general, I would like to have a function... for an EA, .... >> (yes daily setting and removal)

 

I have a question how to lock the chart? How can I change the indicator to always show the distance and not increase it automatically?

i.e. if exchange rate fluctuates in the range of +-100 points for a certain time, MT will increase the rate like watching it closely, thus violating the notion of fluctuation height - how to make it stop automatic increase?

 
firemast >> :

I have a question how to lock the chart? How can I change the indicator to always show the distance and not increase it automatically?

i.e. if exchange rate fluctuates in the range of +-100 points for a certain time, MT will increase it; i.e. it looks close because of that the fluctuation height distortion - how to make it stop automatic increase?

This problem must have been solved before 2003 But since someone else does not know, I'll share)))

Right mouse click on the graph - select properties - general tab - check fixed zoom - OK

Then hover the mouse over the price scale, press left mouse button and keep it pressed, move the mouse up/down adjusting the scale you need.

 

Need some help! Here is a piece of code to open a pendant with a certain magic number if there are 2 positions with this magic number:

//if there are 2 open positions with a given magic number

{if (NumberOfPositions(NULL, -1, FirstMagicNumber)==2)

//{ if there is no pending position with this number

{if ((ExistPositions(NULL, -1, FirstMagicNumber))==(NumberOfPositions(NULL, -1, FirstMagicNumber))

//if the last position type is OP_BUY
{if ((GetTypeLastOpenPos(NULL, FirstMagicNumber))==OP_BUY)

//Put an order
{if (OrderSend(Symbol(), OP_SELLSTOP, 3*Lot, PriceOpenLastPos(NULL, -1, FirstMagicNumber)-Step*Point,
0, 0, 0, NULL, FirstMagicNumber)!=1)
{
Print("1.3.1");
}
else
{
return(0);
}}}}}
I can't understand why it doesn't pause, if all parameters match...

 

This one - what's the weird condition?

//if there is no pending with this number
{if ((ExistPositions(NULL, -1, FirstMagicNumber))==(NumberOfPositions(NULL, -1, FirstMagicNumber))
Give me a decoding of these functions, i.e. what do they return?

//--------------------------------------

The second function returns the number of positions.

And the first ?

 
RomanS >> :

This problem has probably been solved before 2003. But since someone else doesn't know, I'll share)))

Right click on the graph - select properties - general tab - check fixed scale - OK

Then locate it on the price scale, press left mouse button and keep it pressed, move it up/down regulating the scale you need.


Problem solved, but not too clever - after enabling fixed scale in MT,

then when scrolling, now and then you have to look for where the graph has "escaped" to. Even in the primitive QuotesRoom

have made it possible to position the chart always in the centre of the screen with fixed scale.

 
rid >> :

This one - what's the weird condition?

//if there is no pending order with the given number
{if ((ExistPositions(NULL, -1, FirstMagicNumber))==(NumberOfPositions(NULL, -1, FirstMagicNumber))
Give me the deciphering of these functions, i.e. what do they return?

//--------------------------------------

The second function returns the number of positions.

And the first ?

The first one returns the total number of orders (together with pending orders)... Here it is:

int ExistPositions(string symbol, int op, int magic)
{
int NumPos = 0;
for(int i = 0; i < OrdersTotal(); i++)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)
&& OrderSymbol() == symbol
&& OrderType() == op
&& OrderMagicNumber() == magic)
{
NumPos++;
}
}
return(NumPos);
}

 

Is the search not working or what? Or is it just me. It always says nothing is found.

 
In the tester, the Expert Advisor is testing the results, but in real trading on the demo does not perform, why?
 
DET >> :
In the tester, the Expert Advisor is testing the results, but in real trading on the demo does not make deals, why?

Some terminals do not conclude deals, if stops are set at order opening. Try it without any stops. If deals will be opened, this is the problem and it is necessary to modify orders after their opening without any stops.

Reason: