[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 256
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
Yesterday I was in a hurry, had to go. I wrote the question at that moment not the one I wanted.
Actually, I meant Expert Advisors which, under a given condition, send a bunch of orders (a grid). I have not seen in such Expert Advisors that neither spread, nor stop-loss, nor price position above (below Asc or Bid), nor anything else is checked. I'm going to write it myself and show it to everyone.
Why even take some gore-experts as an example? At the very least they are solely for the tester, at the most they are written with crooked hands, as mentioned above...
Why take some woe-experts as an example at all? At the very least they are solely for the tester, at the most they are written with crooked hands, as stated above...
Well, I understood how to implement it, but decided to see how others do it.
Guys, I'm having a really horrible problem! My graph doesn't shift to the left when I save the drawing! The "shift graph" function is activated! How do I fix it?
Hello!
I want my Expert Advisor to open no more than one trade a day. Can you tell me how to do this?
Hello, I've been looking into mql4 for a while now, maybe one of the experienced programmers can help. I want to know how to make it lock when order reaches -30 or -40. I have to add some properties for this script to lock the orders as soon as they go in minus.
void start()
{
double StopLoss;
double Lots=0;
for(int i=0;i<OrdersTotal();i++)
{
if(!OrderSelect(i,SELECT_BY_POS))
continue;
if(OrderSymbol()!=Symbol())
continue;
if(OrderType()==OP_BUY)
Lots+=OrderLots();
if(OrderType()==OP_SELL)
Lots-=OrderLots();
}
if(Lots>0)
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Ask+StopLoss*Point,0,NULL,Red);
if(Lots<0)
OrderSend(Symbol(),OP_BUY,-(Lots),Ask,3,Bid-StopLoss*Point,0,NULL,Blue);
Hello!
I want my Expert Advisor to open no more than one trade a day. Can you tell me how to do this?
Guys, I'm having a really horrible problem! My graph doesn't shift to the left when I save the drawing! The "shift graph" function is activated! How do I fix it?
Well, I understood how to implement it, but I decided to see how others do it.
Thanks for the tip!
Only in the suggested variant the expert doesn't work)))) Here is a working variant that I got :
if (OrdersTotal()==0) // If there are no open positions
{ for (int i=OrdersHistoryTotal()-1; i>=0; i--) // Search for orders from the account history list
{ if (OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)) // the order is selected among the closed orders
{
if (OrderCloseTime()>=iTime(NULL,PERIOD_D1,0)) // If the order close time is greater than or equal to the start of the current candle opening
// The Expert Advisor does not work. Any other period can be inserted instead of PERIOD_D1.
return(-1);
} } }
Why do you even take some woe-experts as an example? At a minimum they are designed exclusively for the tester, at a maximum they are written with crooked hands, as it was said above...
Wrote it my way. I didn't particularly optimize the code, just wrote it to make it work and show the logic.
The step is the order grid spacing.
My question is this. Is my logic correct? Is there any way to improve the code so that it would work faster? From performance point of view...
I also have an idea that we may need to make pauses after each message. Well, all in all these points are very interesting to me.