There is an EA. If the variables Lot, Porog, Otstup, SL, TP are set in the "body" of the program, then the EA works. If these variables are set as "extern" (by setting them via settings), then the EA does not work (in the "body" of the EA, these variables have a value of ZERO).
What can be the problem? Where to look for a solution?
Could you please suggest a function to implement a dialog box where you can specify variable values.
For example, there is a buy script (buy with Sl and Tp set), when you run it, a dialog box is displayed where you can specify e.g. lot size, then press Ok and the order is executed!
I have to shift it on the Label parameter to keep the text on the curve. But when we shift to another period or increase/decrease the chart, the chart scale changes and we have to edit again. Can the text shift be set differently, e.g. in screen pixels?
In my indicator I use a text that displays data about the value of the indicator curve on the chart
To make sure the text does not overlap the curve, we have to shift it by the Label parameter. But when changing to another period or increasing/decreasing the graph, the graph scale changes and you have to edit again. Can the text shift be set differently, e.g. in screen pixels?
You can use
OBJ_LABEL
23
It is a text label. Does not use coordinates. The ObjectSet() function is used to set coordinates set in pixels relative to the reference angle (OBJPROP_CORNER, OBJPROP_XDISTANCE, OBJPROP_YDISTANCE properties). To change the text, function ObjectSetText() is used.
kon12 писал(а)>> I do not quite understand how? I attach a picture of the indicator. The point is that the text is attached to specific points in the indicator.
Then you have to make the Label dynamic. For each timeframe its own. Once in the init and forget about it. But first, you have to select it.
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.
Can you please tell me if I open an order
OrderSend(Symbol(), OP_SELL, Lots, Bid, 3, oSL, oTP, "", ExpertID, 0, Red)
If a Stop Loss is triggered, open double lot on next order opening which is done automatically
Can you please tell me if I open an order
OrderSend(Symbol(), OP_SELL, Lots, Bid, 3, oSL, oTP, "", ExpertID, 0, Red)
If a Stop Loss is triggered, open a doubled lot at the next order opening which is done automatically
Put these lines in the very beginning of the START function and use the variable _SL[0] to determine the outcome of the previous trade.
if (OrderSelect(Tic,SELECT_BY_TICKET)==true)
{
if (OrderComment()=="[sl]")_SL[0]=-1;
if (OrderComment()=="[tp]")_SL[0]=1;
}
Problem.
There is an EA. If the variables Lot, Porog, Otstup, SL, TP are set in the "body" of the program, then the EA works. If these variables are set as "extern" (by setting them via settings), then the EA does not work (in the "body" of the EA, these variables have a value of ZERO).
What can be the problem? Where to look for a solution?
Could you please suggest a function to implement a dialog box where you can specify variable values.
For example, there is a buy script (buy with Sl and Tp set), when you run it, a dialog box is displayed where you can specify e.g. lot size, then press Ok and the order is executed!
Thank you!
Dear Professionals, Please advise...
In my indicator I use a text that displays data about the value of the indicator curve on the chart
I have to shift it on the Label parameter to keep the text on the curve. But when we shift to another period or increase/decrease the chart, the chart scale changes and we have to edit again. Can the text shift be set differently, e.g. in screen pixels?Dear Professionals, Please advise...
In my indicator I use a text that displays data about the value of the indicator curve on the chart
To make sure the text does not overlap the curve, we have to shift it by the Label parameter. But when changing to another period or increasing/decreasing the graph, the graph scale changes and you have to edit again. Can the text shift be set differently, e.g. in screen pixels?You can use
I do not quite understand how? I attach a picture of the indicator. The point is that the text is attached to specific points in the indicator.
Then you have to make the Label dynamic. For each timeframe its own. Once in the init and forget about it. But first, you have to select it.
Can the text shift be set differently, e.g. in screen pixels?
The most correct answer is no.