[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 117
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
Like this:
The ZigZag extrema from the current time to Time_Control are collected in an array.
Can you tell me how to count all the zigzags, how many are there?
Hello,
sorry in advance for the grammar :/. My question is, how to rewrite quotes history (via code)? I would like to use MT4 to analyse data from another broker.Can you tell me how to count all the zigzags, how many are there?
Written in the li_IND variable, or like this
count=ArraySize(lda_Extremum);
Can you tell me how to count all the zigzags, how many are there?
If we do the following:
- the function will return the number of extrema found since fdt_TimeControl.Thank you
Hello,
Is it possible to enter a schedule with a fixed weight 1:1 in the settings?
If it is possible, please tell me how.
I would like to thank you in advance.
Afternoon.
I wrote code to open two pending orders (BuyStop and SellStop) on conditions a=true and b=true and after some time the EA closes both orders, until a new signal appears, but sometimes the EA opens 2 pending orders in the same direction. Why this happens and how to avoid this "bug"?
if (a=true && b=true)
{
int OrderCount = OrdersTotal();
if (OrderCount>1) return(0);
ticket1=OrderSend(Symbol(), OP_BUYSTOP, getLot(), PriceOpen_Buy, slippage, PriceOpen_Sell,0,0,Green);
Sleep(1000);
ticket2=OrderSend(Symbol(), OP_SELLSTOP, getLot(), PriceOpen_Sell, slippage, PriceOpen_Buy,0,0,Green);
Sleep(1000*59*TimeFrame);
for (int i=OrdersTotal()-1; i>=0; i--)
{
if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) break;
if (OrderType()==OP_BUYSTOP ) OrderDelete(OrderTicket());
if (OrderType()==OP_SELLSTOP ) OrderDelete(OrderTicket());
if (OrderType()==OP_SELL ) OrderClose(OrderTicket(),OrderLots(),Ask,slippage);
if (OrderType()==OP_BUY ) OrderClose(OrderTicket(),OrderLots(),Bid,slippage);
}
return(0);
}
Please give me a hint.
Thank you in advance.
The values of these variables are stored in the arrays-traceboxes.
I mean, you've got it like this .
Terms and conditions,
Afternoon.
I wrote code to open two pending orders (BuyStop and SellStop) on conditions a=true and b=true and after some time the EA closes both orders, until a new signal appears, but sometimes the EA opens 2 pending orders in the same direction. Why this happens and how to avoid this "bug"?
Please advise.
Thank you in advance.
Maybe here:
Actually so much is not "sleeping" - Sleep(1000*59*TimeFrame); - a new tick came in, your code started, two orders open, then pause for "2 hours" (conditionally), and then you try to close if suddenly one of the orders became marketable at the prices you got 2 hours ago - ORIGINAL!!! WHO TAUGHT YOU THAT?
You can fix in a global variable the time of opening of orders and control the difference between m³ TimeCurrent() and the fixed time.