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

 
StatBars >>:

Вы не моглы бы весь скрипт выложить? Я имею ввиду вместе с объявлениями переменных массивов и т.д.

Here's the script, I checked it works, it reads fine in both sidebar and double.

 
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.
 
Bicus >>:
Джентльмены, вопрос такой:

В тестере вот такая штука:

в журнале выдает "0.0000".

А в терминале в реал-тайме выдает правильные значения.

Как с этим бороться?

А?

 
Bicus писал(а) >>

А?


>> put out the code, and give me all the details.
 
Techno >>:

выкладывай код, и все подробней

double nMAValue;

... парам-парам ...

nMAValue = iMA (Symbol (), PERIOD_H1, 100, 0, MODE_SMA, PRICE_MEDIAN, 0); 
Print ("MA value: ", DoubleToStr (nMAValue, 4));

... парам-парам ...
 
Bicus писал(а) >>

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
Files:
001.mq4  1 kb
 

Vinin, Bicus.
Thanks for the update on the .csv.
I've been a bit... ...mixed up.)

 
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?
Files:
 
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?


Everything works fine. At least for me
Files:
 
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