Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 155
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
What can you...?
Calculate how many hobbits it takes to change a light bulb?
Send it to freelance? Write "read it there"?
How do I find the coordinate of closing series of orders in the history as in the example (I plan to draw a line at this point)
I've already asked this question on 151 pages of this thread, but no plausible solution has been found .https://www.mql5.com/ru/forum/160683/page151
What can you...?
Calculate how many hobbits it takes to change a light bulb?
Send it to freelance? Write "read it there"?
We CAN do a lot of things:)
The hobbit problem has no one-size-fits-all solution...
In case you didn't understand, my answer was from the same video thatVitalie Postolache quoted.
But seriously:
How do I find the coordinate of a deal closing a series of orders in the history as in the example (I plan to draw a line at this point)
I already asked this question on 151 pages of this thread, but no solution has been found. https://www.mql5.com/ru/forum/160683/page151
I have not read the branch by the link. But it would be like this:
Determine the fact of closing of several orders (one or different types) within X points (X points range is needed because in reality all deals may not close at the same price), determine the average closing price and draw a line by it.
Search the history for a series of orders with the same closing bar. The time of this bar will be the one you are looking for.
Same problem as my solution method: depending on pings and number of orders, all trades on the same candle may not close...
For M1 I agree. For others it is unlikely. If only before the opening of a candlestick an order to close has been received. There will be two sets of orders. Take the last of two adjacent ones.
Little data was given here to decide: several packs may be closed on the same candle (if you check on, say, hourly or daily candlesticks).
I want parallel red lines, but I want them to intersect, and I want three of them to be green and the rest to be purple )))
Oh, yes, and that one straight line in the shape of a kitten!
Does the problem seem wrong to you?
There is not enough data to decide: several packs may be closed on one candle (if you check, say, hour or daily candlesticks).
In any case the more accurate the better ...
the orders are closed in accordance with the trailing stop condition without a loss
i.e.
if(b+s>0)
{
for(i=0; i<OrdersTotal(); i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderSymbol()==Symbol() && Magic==OrderMagicNumber())
{
tip = OrderType();
OSL = NormalizeDouble(OrderStopLoss(),Digits);
OTP = NormalizeDouble(OrderTakeProfit(),Digits);
OOP = NormalizeDouble(OrderOpenPrice(),Digits);
SL=OSL;
if(tip==OP_BUY)
{
SL=NormalizeDouble(Bid-TrailingStop*Point,Digits);
if(SL>OSL && SL>NLb)
{
if(!OrderModify(OrderTicket(),OOP,SL,0,0,White)) Print("Error Order Modify ",GetLastError());
}
}
if(tip==OP_SELL )
{
SL=NormalizeDouble(Ask+TrailingStop*Point,Digits);
if((SL<OSL || OSL==0) && SL<NLs)
{
if(!OrderModify(OrderTicket(),OOP,SL,0,0,White)) Print("Error Order Modify ",GetLastError());
}
Write your own MA indicator, which would include an additional buffer into which the values are entered when a new bar is formed.
I would like to discuss an algorithm for solving the issue, including for differentmoving average averaging methods.
We CAN do many things:)
Determine the fact of closing several orders (of the same or different types) within X points (X points range is needed because in reality all deals may not close at the same price), determine the average closing price and draw a line by it.
this should be added to the script ...
Taking into account the fact that if a series of Sell orders are closed
ObjectCreate(Ticket+'Debt B',OBJ_HLINE,0,0,d);
ObjectSet(Ticket+'Debt B',OBJPROP_COLOR,LimeGreen);
ObjectSet(Ticket+'Debt B',OBJPROP_WIDTH,1);
if a series of buy orders are closed
ObjectCreate(Ticket+'Debt M',OBJ_HLINE,0,0,d);
Can you help?ObjectSet(Ticket+'Debt M',OBJPROP_COLOR,Red);
ObjectSet(Ticket+'Debt M',OBJPROP_WIDTH,1);
I would like to discuss the algorithm for dealing with the issue, including for differentmoving average averaging methods.