Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 145
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
as I understood it (hopefully correctly:)) Zolotai wants to take data from two loop statements and write them to text files. From each one to a separate file. Then he wants to load the data from these files into arrays. Then these two arrays should be joined into one array so that the data from two operators are not mixed and correlated with each other by each bar.
like this))))
People, I need help, the code below is executed only the second part, when sellstop should be set, and buystop for some reason is not set, although all conditions are met, I can not even see what's wrong))
if (OrdersTotal()==2)
{
OrderSelect(2,SELECT_BY_TICKET);
if (OrderType()==OP_SELL)
{
OrderSelect(2,SELECT_BY_TICKET);
double b = OrderOpenPrice();
OrderSend(Symbol(),OP_BUYSTOP,2,b+28*Point,3,b-25*Point,b+50*Point,0,5);
}
OrderSelect(4,SELECT_BY_TICKET);
if (OrderType()==OP_BUY)
{
OrderSelect(4,SELECT_BY_TICKET);
double a = OrderOpenPrice();
OrderSend(Symbol(),OP_SELLSTOP,2,a-28*Point,3,a+25*Point,a-50*Point,0,6);
}
}
Well, since you know for sure that order number 2 is a sell order, all you have to do is normalise the price, stop and take.
And watch the EA logs.
Hello, Can you advise me please - I am looking for an owl or a script:
There is an order level there is a stop and 3 takeprofits, it is necessary that when a certain level is reached for example the first tr order is closed by a certain part (set by myself) and the remaining part is transferred to a level that I also set myself..:
Example
order at 1.5800 stop 1.5750 1 position - 1.5850 2 points - 1.5900 3 points - 1.5950, so when the order reaches 1.5850 let us assume 40% of the lot is closed, the rest at 1.5800 (ie in bu) to 2 points 20% and the rest is transferred to 1.5850 and 3 points are closed completely.
The most important thing is to be able to change the values myself depending on the situation.
People, I need help, the code below is executed only the second part, when sellstop should be set, and buystop for some reason is not set, although all conditions are met, I can not even see what's wrong))
if (OrdersTotal()==2)
{
OrderSelect(2,SELECT_BY_TICKET);
if (OrderType()==OP_SELL)
{
OrderSelect(2,SELECT_BY_TICKET);
double b = OrderOpenPrice();
OrderSend(Symbol(),OP_BUYSTOP,2,b+28*Point,3,b-25*Point,b+50*Point,0,5);
}
OrderSelect(4,SELECT_BY_TICKET);
if (OrderType()==OP_BUY)
{
OrderSelect(4,SELECT_BY_TICKET);
double a = OrderOpenPrice();
OrderSend(Symbol(),OP_SELLSTOP,2,a-28*Point,3,a+25*Point,a-50*Point,0,6);
}
}
Hello, Can you advise me please - I am looking for an owl or a script:
There is an order level there is a stop and 3 takeprofits, it is necessary that when a certain level is reached for example the first tr order is closed by a certain part (set by myself) and the remaining part is transferred to a level that I also set myself..:
Example
order at 1.5800 stop 1.5750 1 position - 1.5850 2 points - 1.5900 3 points - 1.5950, so when the order reaches 1.5850 let us assume 40% of the lot is closed, the rest at 1.5800 (ie in bu) to 2 points 20% and the rest is transferred to 1.5850 and 3 points are closed completely.
The most important thing is to be able to change the values myself depending on the situation.
Guys, tell me about this shit!!! When I create a new indicator, I always have a problem with the output of the buffer to the chart. I seem to have written everything correctly, but the values do not show any.... I'm already exhausted....
What should I do to output the fifth buffer?People, I need help, the code below is executed only the second part, when sellstop should be set, and buystop for some reason is not set, although all conditions are met, I can not even see what's wrong))
if (OrdersTotal()==2)
{
...
To properly insert code in the forum, click SRC
We should actually use if to select the order
I usually send orders by separate functions. I would like to optimise this, so that I can send both pending and market orders with one function.
Please, advise how to implement it correctly?
When sending pending orders, we should check opening price above (below) the Bid price and take into consideration some other aspects.
Let's look how others do it. Let's take the simplest variant used by Kim:
He does not check anything at all. We can see that his function is intended only for opening market orders.
I don't think this is logical. If you send an order, it will be of any type. If you write it the way I think, it will be too long, at first glance.
In general, I am asking for help and hints on how to better implement these points.