All in all, I'm a decent mess, what can I say! The specialist immediately told me to look at arrays, not type conversions...
StatBars, Vinin, everyone who responded, thank you very much.
The problem was that my arrays were dynamic. And there is a certain specificity of type conversion there. adjusted to arrays of deterministic length, and type conversion with StrToDouble worked like clockwork.
Thanks a lot again. Working with files is a useful thing. I'm trying to figure it out now.
It works for me correctly, the value in the tester is correct. here is the code if anything, you probably have a mistake in the rest of the code somewhere
Dear Sirs, I have encountered a problem with the OrderSend function, namely my order is not opening. For example, if I attach this EA to a chart - extern double StopLoss = 30; extern double TakeProfit = 30; extern double lot = 0.1; double SL,TP; string Symb; int start() { Symb=Symbol(); SL =Bid - (StopLoss*Point); TP =Bid + (TakeProfit*Point); OrderSend(Symb,OP_BUY,lot,Ask,3,SL,TP); if(OrdersTotal()>0) Alert("Buy order opened"); if(OrdersTotal()==0) Alert("Buy order failed because.error #",GetLastError()); Alert("Point = ",Point); return; } the terminal will show error #130 (wrong stops) and the Point value will be 0. I think it's because of returned Point value (though who knows). In general who knows "where the dog is buried" help. By the way, should the Point value = 0 or not?
159753 писал(а)>> Dear Sirs, I have encountered a problem with the OrderSend function, namely my order does not open. For example, if I attach this EA to a chart - extern double StopLoss = 30; extern double TakeProfit = 30; extern double lot = 0.1; double SL,TP; string Symb; int start() { Symb=Symbol(); SL =Bid - (StopLoss*Point); TP =Bid + (TakeProfit*Point); OrderSend(Symb,OP_BUY,lot,Ask,3,SL,TP); if(OrdersTotal()>0) Alert("Buy order opened"); if(OrdersTotal()==0) Alert("The Buy order failed to open due to error #",GetLastError()); Alert("Point = ",Point); return; } the terminal will display error #130 (wrong stops) and the Point value will be =0. I think it's because of returned Point value (though who knows). In general, who knows "where the dog is buried" help. By the way, should the Point value = 0 or not?
159753>>: Уважаемые господа, я столкнулся с проблемой, связанной с функцией OrderSend, а именно у меня не открывается ордер. К примеру, если присоединить этот советник к графику - extern double StopLoss = 30; extern double TakeProfit = 30; extern double lot = 0.1; double SL,TP; string Symb; int start() { Symb=Symbol(); SL =Bid - (StopLoss*Point); TP =Bid + (TakeProfit*Point); OrderSend(Symb,OP_BUY,lot,Ask,3,SL,TP); if(OrdersTotal()>0) Alert("Ордер Buy открыт"); if(OrdersTotal()==0) Alert("Ордер Buy открыть не удалось т.к. возникла ошибка №",GetLastError()); Alert("Point = ",Point); return; } то терминал выдаст ошибку № 130 (неправильные стопы), а значение Point будет = 0. Я думаю, что всё из-за возвращаемого значения Point (хотя кто его знает). В общем кто знает "где собака зарыта " помогите. Кстати, значение Point должно = 0 или нет?
Point cannot be 0, you probably have the 5th digit, so when you print (Alert) you get 0 (print (Alert) outputs up to 4 tsnacks, unless you convert it to a DoubleToStr string...) try TakeProfit and StopLoss multiplied by 10
Вы не моглы бы весь скрипт выложить? Я имею ввиду вместе с объявлениями переменных массивов и т.д.
Here's the script, I checked it works, it reads fine in both sidebar and double.
The specialist immediately told me to look at arrays, not type conversions...
StatBars, Vinin, everyone who responded, thank you very much.
The problem was that my arrays were dynamic. And there is a certain specificity of type conversion there.
adjusted to arrays of deterministic length, and type conversion with StrToDouble worked like clockwork.
Thanks a lot again.
Working with files is a useful thing. I'm trying to figure it out now.
Джентльмены, вопрос такой:
В тестере вот такая штука:
в журнале выдает "0.0000".
А в терминале в реал-тайме выдает правильные значения.
Как с этим бороться?
А?
А?
>> put out the code, and give me all the details.выкладывай код, и все подробней
Vinin, Bicus.
Thanks for the update on the .csv.
I've been a bit... ...mixed up.)
For example, if I attach this EA to a chart -
extern double StopLoss = 30;
extern double TakeProfit = 30;
extern double lot = 0.1;
double SL,TP;
string Symb;
int start()
{
Symb=Symbol();
SL =Bid - (StopLoss*Point);
TP =Bid + (TakeProfit*Point);
OrderSend(Symb,OP_BUY,lot,Ask,3,SL,TP);
if(OrdersTotal()>0) Alert("Buy order opened");
if(OrdersTotal()==0) Alert("Buy order failed because.error #",GetLastError());
Alert("Point = ",Point);
return;
}
the terminal will show error #130 (wrong stops) and the Point value will be 0.
I think it's because of returned Point value (though who knows).
In general who knows "where the dog is buried" help.
By the way, should the Point value = 0 or not?
Dear Sirs, I have encountered a problem with the OrderSend function, namely my order does not open.
For example, if I attach this EA to a chart -
extern double StopLoss = 30;
extern double TakeProfit = 30;
extern double lot = 0.1;
double SL,TP;
string Symb;
int start()
{
Symb=Symbol();
SL =Bid - (StopLoss*Point);
TP =Bid + (TakeProfit*Point);
OrderSend(Symb,OP_BUY,lot,Ask,3,SL,TP);
if(OrdersTotal()>0) Alert("Buy order opened");
if(OrdersTotal()==0) Alert("The Buy order failed to open due to error #",GetLastError());
Alert("Point = ",Point);
return;
}
the terminal will display error #130 (wrong stops) and the Point value will be =0.
I think it's because of returned Point value (though who knows).
In general, who knows "where the dog is buried" help.
By the way, should the Point value = 0 or not?
Everything works fine. At least for meУважаемые господа, я столкнулся с проблемой, связанной с функцией OrderSend, а именно у меня не открывается ордер.
К примеру, если присоединить этот советник к графику -
extern double StopLoss = 30;
extern double TakeProfit = 30;
extern double lot = 0.1;
double SL,TP;
string Symb;
int start()
{
Symb=Symbol();
SL =Bid - (StopLoss*Point);
TP =Bid + (TakeProfit*Point);
OrderSend(Symb,OP_BUY,lot,Ask,3,SL,TP);
if(OrdersTotal()>0) Alert("Ордер Buy открыт");
if(OrdersTotal()==0) Alert("Ордер Buy открыть не удалось т.к. возникла ошибка №",GetLastError());
Alert("Point = ",Point);
return;
}
то терминал выдаст ошибку № 130 (неправильные стопы), а значение Point будет = 0.
Я думаю, что всё из-за возвращаемого значения Point (хотя кто его знает).
В общем кто знает "где собака зарыта " помогите.
Кстати, значение Point должно = 0 или нет?
Point cannot be 0, you probably have the 5th digit, so when you print (Alert) you get 0 (print (Alert) outputs up to 4 tsnacks, unless you convert it to a DoubleToStr string...)
try TakeProfit and StopLoss multiplied by 10