c3po:
Is this how to print when a new order opens?
No.
c3po: Is this how to print when a new order opens?
if(OrdersTotal() ++) Print(“a new Order has opened, OrdersTotal() is now = “+OrdersTotal() );
- OrdersTotal() returns a number (say 5). 5++ is 6. What does if(6) mean?
- You need to remember the old value so you know when it changes.
static int OTcurrent; int OTprevious = OTcurrent; OTcurrent = OrdersTotal(); if(OTcurrent > OTprevious) Print("new order");
- Do you care whether another EA or a human opened an order on another chart? Shouldn't you only care about your orders on your chart? You know that when you called OrderSend().
- If you want to know whether a pending order opened, then you need to look for an increase of your open orders.
static int OTcurrent; int OTprevious = OTcurrent; OTcurrent = MyOrdersTotal(OP_BUY) + MyOrdersTotal(OP_SELL); if(OTcurrent > OTprevious) Print("new order");
Yes, it`s so. But static mode is not realised correctly in mt4, so I recomend to use global data section.
tara:
Yes, it`s so. But static mode is not realised correctly in mt4, so I recomend to use global data section.
what is wrong with static mode ?
Yes, it`s so. But static mode is not realised correctly in mt4, so I recomend to use global data section.
WHRoeder:
static int OTcurrent; int OTprevious = OTcurrent; OTcurrent = OrdersTotal(); if(OTcurrent > OTprevious) Print("new order");
got it boss. This is like taking a snapshot with a video camera and comparing the two. Then MyOrdersTotal to filter out everything but current chart, symbol, magic, etc. Thanks.
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
Is this how to print when a new order opens?
thanks pros :)