-
Play videoPlease edit your post.
For large amounts of code, attach it.
if (OrderClosePrice( ) == OrderStopLoss())
This is unlikely to ever be true. A stop becomes a market order and is filled at market price with slippage. Also there is The == operand. - MQL4 forum- macdulio_: Run cycle on CLOSED ORDERS that were made on THIS DAYWhere are you checking the time?
WHRoeder:
-
Play videoPlease edit your post.
For large amounts of code, attach it.
- This is unlikely to ever be true. A stop becomes a market order and is filled at market price with slippage. Also there is The == operand. - MQL4 forum
- macdulio_: Run cycle on CLOSED ORDERS that were made on THIS DAYWhere are you checking the time?
2. This is not an everyday broker, they are not market makers and the spread is 0.2 pips plus variable on EURUSD.
The image shows the stop losses highlighted as well as the closing prices, that are equal.
3. I currently have no clue about how to get the day out of the CloseOrderPrice();
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
Hi,
I'm running 6-8 scalper EAs at once. Today there was a massacre when I went out to eat and by the time I got back the 3.2% daily gain was replaced by 1.5% loss in a 30 minute window with 6 different scalping attempts that were called to dance and hit the stop out.
This is what I am hoping to get done - after I manage to collect enough information on this topic
Run cycle on CLOSED ORDERS that were made on THIS DAY
counter = 0;
i = OrdersHistoryTotal();
while (i>=0 && counter<3 - and the day part of the OrderCloseTime says it is from today)
if (OrderSelect(i, SELECT_BY_POS))
if (OrderType() == ORDER_TYPE_BUY || OrderType() == ORDER_TYPE_SELL )
if (OrderClosePrice( ) == OrderStopLoss())
counter = counter +1;
else counter = 0;
i--;
later if i==3 then all the rest of the routine is excluded via an else branch;
the trades opened and deleted and the ones opened and closed at other prices than the stop loss do not matter
order buy and order sell are trades that got already triggered