Questions from Beginners MQL5 MT5 MetaTrader 5 - page 123
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
so tryhttp://www.mql5.com/ru/docs/customind/indicators_examples/draw_none
Successfully traded on alpari MT4 with ilan 2.0 (1.6) with sensible settings, until alerts started coming in about frequent unproductive requests that load up the server for nothing. Turned out that in a fast market alpari increases the minimum possible stop loss setting level to 2 spreads, which corresponded to 40 pips, sometimes less. But my EA seems to set this value in the range of 15-55 pips, which I have understood from reading the code of the EA. But alpari was not satisfied with it and I was threatened with blocking, so I have stopped trading. I didn't really know mql4, I have just edited these lines in the code, which seemed to me the only lines responsible for the problem, it is in the tab of any ilan, near the beginning:
double PrevCl;
double CurrCl;
if (UseTrailingStop) TrailingAlls(TrailStart, TrailStop, AveragePrice);
if ((iCCI(NULL,15,55,0,0)>Drop && ShortTrade)||(iCCI(NULL,15,55,0,0)<(-Drop) && LongTrade)) {
Where I stupidly changed the numbers 15 to 40 to solve the problem, but further I learned from alpari that the problem is not solved, i.e. I did something wrong, which is not surprising. Can you advise me how to edit the EA code correctly so that it puts the stop loss level in the 40-55 pips range instead of 15-55. I know the 40-55 point range is not a big enough for a comfortable stop-loss set and it's too far from the price, which reduces the profit. But I have no choice, I do not want to leave alpari, it is comfortable there. There is no corresponding parameter in standard EA settings.
This is the display style when writing your own indicator, but I need to hide from the user a bunch of standard indicators used in the Expert Advisor...
Good day!
I will not have enough energy to reread 125 pages, so I have to ask a question right away: I drew an assistant for myself and checked it on forex, it works fine.
2013.06.11 18:42:00 Trades '1002754': failed buy limit 1.00 RTS-6.13 at 125840 [Invalid expiration]
trade request looks like this
[CODE]
if (i >= total_orders)
{Stop = false;
//--- prepare request
MqlTradeRequest request={0};
request.action=TRADE_ACTION_PENDING; //set a pending order
request.magic=magic_number; // ORDER_MAGIC
request.symbol=_Symbol; // instrument
request.volume=order_send_lot; // volume in lot
request.price=order_send_price; //open price
request.sl=0; // Stop Loss is not specified
request.tp=0; // Take Profit is not specified
request.type=order_type; // order type
request.type_filling=ORDER_FILLING_RETURN;
request.type_time=ORDER_TIME_GTC;
//request.stoplimit=0;
//request.expiration=D'2013.06.12';
request.comment=IntegerToString(id_position);//comment
//--- send a trade order
MqlTradeResult result={0};
OrderSend(request,result);
}
i++;
[/CODE]
I already tried different variants type_filling and type_time, but the result is the same.
What can I do about it?
Good Profit to all!!! Can you please advise whether there is a function to universally place two counter pending orders, then delete pending orders that are pending or limit their hovering by time.
There is unlikely to be a ready-made function for two orders. The time limit is set in the pendants themselves:
MqlTradeRequest request={0};
request.type_time=ORDER_TIME_GTC;
request.expiration=D'2013.06.20';
Good day to all!
How to calculate buy and sell price using historical data (my tester)?
Buy close+spread*_Point , and sell close correct?
There is unlikely to be a ready-made function for two orders. The time limit is set in the pendants themselves:
MqlTradeRequest request={0};
request.type_time=ORDER_TIME_GTC;
request.expiration=D'2013.06.20';
HOLDING on a pair in the EA is slowing it down. Isn't there a faster way to expire the hang? How would I bind it to ticks or bars? Moreover, my brokerage company limits the number of orders and we cannot use a grid.
Who can tell me what controller is used for the tumbler?
I want one with progressions in cells for sharpe.