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

 
Roger:

Maybe because the script was written a long time ago and had 4 digits, now it has 5. i need to increase the stop and take orders by 10 times.


Thanks for the answer, but I'm a little confused. When I request iOpen(Symbol(),PERIOD_H4,0) it gives me a price with 4 decimal places.

If i can, please advise how to prescribe the number of lots, which should use the order to open (assumed to use 10% of available funds to trade on the account)?

I would be very grateful.

 

Can you tell me please, when testing an EA - whatever period I choose it tests only the last 2-3 weeks... Why is this so?

I want to test a year =((

 
kon12:
Is that right?

It looks like it. Just remember to check with a tester.
 
Boneshapper:


Thanks for the answer, but I'm a little confused. When I request iOpen(Symbol(),PERIOD_H4,0) it gives me a price with 4 decimal places.

If i can, please advise how to prescribe the number of lots, which should use the order to open (assumed to use 10% of available funds to trade on the account)?

I would be very grateful.


The price he gives with 5 digits, you see only 4, but that's not the tricky part. Usually, when you open orders to set a stop price you use a relative value in pips and then multiply it by the value of a pip. Therefore, if you set a 50 pip stop and have a 4-digit stop at 0.0001, you will get the difference between the open price and the stop at 0.005, but if you have a 5-digit stop, it will be 0.00001 and it will be only 0.0005, which will not let you open an order with a too low stop.

The lot size is calculated from the value of the lot and the exchange rate of the base currency to the currency of your deposit. But basically it's simple arithmetic, try to work out the formula yourself.

 
w_ersoc:

Can you tell me please, when testing an EA - whatever period I choose it tests only the last 2-3 weeks... Why is this so?

I want to test a year =((


Must be missing history. Pull back the graph with the mouse so that it pumps the data from the server.
 
Roger:


The price is given with 5 digits, you see only 4, but that's not the tricky part. Usually, when opening orders for setting a stop, we use a relative value in pips and then multiply it by the value of a pip. In other words, if you set a 50 pip stop and have a 4-digit stop at 0.0001, you would have a difference of 0.005 between the open price and the stop, but if you have a 5-digit stop, you would have a difference of 0.00001 and it would only be 0.0005, which would make your stop too short.

The lot size is calculated from the value of the lot and the exchange rate of the base currency to the currency of your deposit. But basically it's simple arithmetic, try to work out the formula yourself.


Ok, I will definitely try it.Thank you very much for your answers!
 

MarketInfo(Symbol (),MODE_POINT) function always returns 0. AndPoint variable all the time also returns 0.

I have another question, the order is not opened, but I have prescribed it correctly.

OP1H = iOpen(Symbol(),PERIOD_H1,0);
OP_D = iOpen(Symbol(),PERIOD_D1,0);
SL = OP_D-0.0055;
TP = OP1H+0.0050;
OrderSend (Symbol (), OP_BUY, 0,01,OP1H, 2, SL, TP,Lime);

 

Can you tell me if there is an in-house or out-of-house function that returns the lot size of the last closed position?

 
david2:

Can you tell me if there is an in-house or out-of-house function that returns the lot size of the last closed position?


see here - it's definitely there. Under - work with orders and positions...
 
Boneshapper:

MarketInfo(Symbol (),MODE_POINT) function always returns 0. And Point variable all the time also returns 0.

Please advise how to open the order, even though I have prescribed it correctly.

OP1H = iOpen(Symbol(),PERIOD_H1,0);
OP_D = iOpen(Symbol(),PERIOD_D1,0);
SL = OP_D-0.0055;
TP = OP1H+0.0050;
OrderSend (Symbol (), OP_BUY, 0,01,OP1H, 2, SL, TP, Lime);


There might be a lot of mistakes here - read the tutorial carefully - this section - so that all your order opening conditions match those specified in this section, and also - don't forget to normalize prices.

For example, look at normalize TP. Besides, press F1 on the normalization function and carefully read its help - NormalizeDouble ().

In addition, check the lot size 0.01 - this is a micro lot; try entering 0.1 - your account might not be a micro account.

..........
TP = NormalizeDouble ((PRICE + Mul1*iATR(Symbol(), 0, ATRPeriod_3, 1)), Digits) ;      // TakeProfit (цена)
         
         if (TP<Level_new*Point) TP=Level_new*Point;   // Если меньше допустимого, то допустимый  
         
         Ticket=OrderSend(Symbol(),4,Lots_New,PRICE,5,SL,TP,"Classiс_3_screen",Magic,0,Green); 
...........
Reason: