I have it like this - opening an order with zero TP and SL, and then modifying (the order) with the required TP and SL parameters. I already wrote, everything works and worked fine on other accounts, only on ndd such a thing. Haven't worked with anyone else with similar accounts before, can't compare. Maybe it's only forex4u's bleeping, or maybe all ndd accounts. I would like to know for future reference.
Since you have an error of 130, then look at the stop order parameters. In any case, they should be no closer than the StopLevel value set in the server settings. If it is equal to zero, then use double spread+1 point
I have it like this - opening an order with zero TP and SL, and then modifying (the order) with the right TP and SL parameters. I already wrote, everything works and worked fine on other accounts, only on ndd such a thing. Haven't worked with anyone else with similar accounts before, can't compare. Maybe it's only forex4u's bleeping, or maybe all ndd accounts. Would like to know for further information.
When opening positions, use these functions to calculate correct stops and takes:
Artyom Trishkin: If you have error 130, then look at parameters of stop-orders. In any case, they must not be closer than the StopLevel value set in the server settings. If it is equal to zero, then use double spread + 1 point
Thank you very much for the features given, in your next post.
The thing is, I have no stops set at all (averaging). And why this error is not present when I start the terminal in the morning and modification occurs, but only present (error) at the beginning of the session when opening an order (daily charts) and if it is one on a pair. The technical support has replied that there are no limitations for this modification either in time or distance (the spread is not important).
I will try to do some experiments with all recommendations and I will draw my conclusions later.
The difference is that my namesake also multiplies by Point for some reason:(OrderCommission()/(tv*OrderLots()))*Point()
OK, I'll answer: There is a price of 1.0520, in calculations we got the number (int)Comm, then we need to add / subtract it from the price = 1.0520 + (int)Comm ? Now, in order not to multiply by Point - this is done immediately.
Thank you very much for the features given, in your next post.
The thing is, I don't have stops (averaging) set at all. And why this error is not present when I start the terminal in the morning and modification occurs, but only present (error) at the beginning of the session when opening an order (daily charts) and if it is one on a pair. The technical support has replied that there are no limitations for this modification either in time or distance (the spread is not important).
I will try to do some experiments with all recommendations and I will draw my conclusions later.
Thank you very much once again.
You're welcome.
To use it this way: In the function of position opening, instead of the stop in pips, copy the function call, in which you place the stop in pips. Or the stop price should be entered directly - the compiler will select the required function. The same for take profit.
Example:
double price=SymbolInfoDouble(Symbol(),SYMBOL_ASK); // Цена открытия для Buydouble sl=CorrectStopLoss(Symbol(), OP_BUY, price, 200); // Стоп в 200 пунктов (вместо пунктов можно вписать расчётную цену, например Ask+200*Point() или значение цены МА)double tp=CorrectTakeProfit(Symbol(), OP_BUY, price, 300); // Тейк в 300 пунктов (если вписать расчётную цену, то будет использоваться тип функции с double-параметром)OrderSend(Symbol(),OP_BUY,Lots,price,slippage,sl,tp,"Комментарий ордера",Magic,0,clrBlue);
OK, I'll answer: There is a price of 1.0520, in calculations we got the number (int)Comm, then we need to add / subtract it from the price = 1.0520 + (int)Comm ? Now, in order not to multiply by Point - this is done immediately.
Well, then maybe so. It's just that the question was originally posed how to translate the commission into pips, not into price.
Use this way: In the function to open a position instead of the stop in pips, type the call of the function in which you want to substitute the stop in pips. Or the stop price should be entered directly - the compiler selects the required function. The same for take profit.
Please advise Dear Sirs: I draw Fibonacci lines with different colours and style levels and always set the same as the last one, how to fix it?
ObjectCreate(0,Fibo_Arrow,OBJ_FIBO,0,Time[0],Close[0],Time[0],price); // создание метки стпа на графике ObjectSetInteger(0,Fibo_Arrow,OBJPROP_HIDDEN,true); // Запрет на показ имени графического объекта в списке объектов ObjectSetInteger(0,Fibo_Arrow,OBJPROP_SELECTABLE,false); // запрет на выделение перемещение объекта мышью ObjectSetInteger(0,Fibo_Arrow,OBJPROP_RAY_RIGHT,false); // луч вправоObjectSetString(0,Fibo_Arrow,OBJPROP_TOOLTIP,"r\n"); // подпись линии и и её длины в подсказку ObjectSetInteger(0,Fibo_Arrow,OBJPROP_COLOR,1,clrNONE); // цвет ObjectSetInteger(0,Fibo_Arrow,OBJPROP_LEVELS,3); // установим количество уровней ObjectSetDouble(0,Fibo_Arrow,OBJPROP_LEVELVALUE,0,1.5); // значение уровня ObjectSetInteger(0,Fibo_Arrow,OBJPROP_LEVELCOLOR,0,Green); // цвет уровня ObjectSetInteger(0,Fibo_Arrow,OBJPROP_LEVELSTYLE,0,2); // стиль уровня ObjectSetInteger(0,Fibo_Arrow,OBJPROP_LEVELWIDTH,0,0); // толщина уровня ObjectSetString(0,Fibo_Arrow,OBJPROP_LEVELTEXT,0,"0.5"); // описание уровня ObjectSetDouble(0,Fibo_Arrow,OBJPROP_LEVELVALUE,1,2); // значение уровня ObjectSetInteger(0,Fibo_Arrow,OBJPROP_LEVELCOLOR,1,Lime); // цвет уровня ObjectSetInteger(0,Fibo_Arrow,OBJPROP_LEVELSTYLE,1,0); // стиль уровня ObjectSetInteger(0,Fibo_Arrow,OBJPROP_LEVELWIDTH,1,0); // толщина уровня ObjectSetString(0,Fibo_Arrow,OBJPROP_LEVELTEXT,1,"1"); // описание уровня ObjectSetDouble(0,Fibo_Arrow,OBJPROP_LEVELVALUE,2,2.5); // значение уровня ObjectSetInteger(0,Fibo_Arrow,OBJPROP_LEVELCOLOR,2,Green); // цвет уровня ObjectSetInteger(0,Fibo_Arrow,OBJPROP_LEVELSTYLE,2,2); // стиль уровня ObjectSetInteger(0,Fibo_Arrow,OBJPROP_LEVELWIDTH,2,0); // толщина уровня ObjectSetString(0,Fibo_Arrow,OBJPROP_LEVELTEXT,2,"1.5"); // описание уровня
Money_Maker: Dear Experts, please advise: I build Fibonacci lines with different colour and style of levels, but always set the same as the last one, how to fix? redraw and slip is not helpful in any place(
Fibo levels with this object, you can't make different styles and colours for each line. Draw separate lines if you want a rainbow.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I have it like this - opening an order with zero TP and SL, and then modifying (the order) with the required TP and SL parameters. I already wrote, everything works and worked fine on other accounts, only on ndd such a thing. Haven't worked with anyone else with similar accounts before, can't compare. Maybe it's only forex4u's bleeping, or maybe all ndd accounts. I would like to know for future reference.
I have it like this - opening an order with zero TP and SL, and then modifying (the order) with the right TP and SL parameters. I already wrote, everything works and worked fine on other accounts, only on ndd such a thing. Haven't worked with anyone else with similar accounts before, can't compare. Maybe it's only forex4u's bleeping, or maybe all ndd accounts. Would like to know for further information.
When opening positions, use these functions to calculate correct stops and takes:
What is the difference
Pips = Charge/Lots/Tickvalue in specific figures 8/2/4 = 1
or
Pips = Charge/(Lots*Tickvalue) in specific numbers 8/(2*4) = 8/8 = 1
Fractional numbers can also be used...
The difference is that my namesake also multiplies byPoint for some reason:(OrderCommission()/(tv*OrderLots()))*Point()
If you have error 130, then look at parameters of stop-orders. In any case, they must not be closer than the StopLevel value set in the server settings. If it is equal to zero, then use double spread + 1 point
Thank you very much for the features given, in your next post.
The thing is, I have no stops set at all (averaging). And why this error is not present when I start the terminal in the morning and modification occurs, but only present (error) at the beginning of the session when opening an order (daily charts) and if it is one on a pair. The technical support has replied that there are no limitations for this modification either in time or distance (the spread is not important).
I will try to do some experiments with all recommendations and I will draw my conclusions later.
Thank you very much once again.
The difference is that my namesake also multiplies by Point for some reason:(OrderCommission()/(tv*OrderLots()))*Point()
OK, I'll answer: There is a price of 1.0520, in calculations we got the number (int)Comm, then we need to add / subtract it from the price = 1.0520 + (int)Comm ? Now, in order not to multiply by Point - this is done immediately.
Thank you very much for the features given, in your next post.
The thing is, I don't have stops (averaging) set at all. And why this error is not present when I start the terminal in the morning and modification occurs, but only present (error) at the beginning of the session when opening an order (daily charts) and if it is one on a pair. The technical support has replied that there are no limitations for this modification either in time or distance (the spread is not important).
I will try to do some experiments with all recommendations and I will draw my conclusions later.
Thank you very much once again.
You're welcome.
To use it this way: In the function of position opening, instead of the stop in pips, copy the function call, in which you place the stop in pips. Or the stop price should be entered directly - the compiler will select the required function. The same for take profit.
Example:
OK, I'll answer: There is a price of 1.0520, in calculations we got the number (int)Comm, then we need to add / subtract it from the price = 1.0520 + (int)Comm ? Now, in order not to multiply by Point - this is done immediately.
Well, then maybe so. It's just that the question was originally posed how to translate the commission into pips, not into price.
You're welcome.
Use this way: In the function to open a position instead of the stop in pips, type the call of the function in which you want to substitute the stop in pips. Or the stop price should be entered directly - the compiler selects the required function. The same for take profit.
Example:
Dear Experts, please advise: I build Fibonacci lines with different colour and style of levels, but always set the same as the last one, how to fix? redraw and slip is not helpful in any place(
Fibo levels with this object, you can't make different styles and colours for each line. Draw separate lines if you want a rainbow.