weird stopped because of Stop Out

 

I know this error happens because there is no freemargin or the balance is in zero

but I cannot figure how is this happening with a big enough balance that has only increased

Suddenly after my last buy which is of the same ammount as the previous ones, the program stops but as you can see I have freemargin available. I started with a freemargin:1000, balance:10000, leverage 1:400 and each buy order has been of 1.0 lots so it's weird to see this happening with a much bigger balance and margin than what I started.

 

2016.06.05 23:16:12.640 EURUSD,M5: 2096911 tick events (31613 bars, 5174350 bar states) processed in 0:00:08.110 (total time 0:00:13.735)

2016.06.05 23:16:12.640 2016.02.15 15:18  practice1 EURUSD,M5: Order:1.1207 closed at:1.1177 orders:0 equity:414.4367 balance:414.4367 freemargin:-3818.1308 profit:-307pips 

2016.06.05 22:55:50.341 2016.02.15 15:18  ... all orders closed

2016.06.05 22:55:50.341 2016.02.15 15:18  Tester: order #108 is closed

2016.06.05 22:55:50.341 2016.02.15 15:18  Tester: order #109 is closed

2016.06.05 22:55:50.341 2016.02.15 15:18  practice1: stopped because of Stop Out

2016.06.05 23:26:28.871 2016.02.15 09:40  practice1 EURUSD,M5: bid:1.1204 ask:1.1207 margin:4232.5675 freemargin:7476.8692 balance:24396.4067 equity:11709.4367

2016.06.05 23:26:28.871 2016.02.15 09:40  practice1 EURUSD,M5: open #109 buy 1.00 EURUSD at 1.12074 ok

2016.06.05 23:26:28.808 2016.02.15 06:20  practice1 EURUSD,M5: bid:1.1226 ask:1.1229 margin:3952.42 freemargin:10769.0167 balance:24396.4067 equity:14721.4367

2016.06.05 23:26:28.808 2016.02.15 06:01  practice1 EURUSD,M5: bid:1.1223 ask:1.1226 margin:3952.42 freemargin:10377.0167 balance:24396.4067 equity:14329.4367

2016.06.05 23:26:28.802 2016.02.15 04:50  practice1 EURUSD,M5: bid:1.1221 ask:1.1224 margin:3952.42 freemargin:10139.0167 balance:24396.4067 equity:14091.4367

2016.06.05 23:26:28.802 2016.02.15 04:50  practice1 EURUSD,M5: open #108 buy 1.00 EURUSD at 1.12242 ok

2016.06.05 23:26:28.739 2016.02.15 00:35  practice1 EURUSD,M5: bid:1.1228 ask:1.1231 margin:3671.8525 freemargin:11333.5842 balance:24396.4067 equity:15005.4367

2016.06.05 23:26:28.739 2016.02.15 00:35  practice1 EURUSD,M5: open #107 buy 1.00 EURUSD at 1.12310 ok

2016.06.05 23:26:28.670 2016.02.12 19:44  practice1 EURUSD,M5: bid:1.1249 ask:1.1252 margin:3391.115 freemargin:14235.4019 balance:24396.4067 equity:17626.5169

2016.06.05 23:26:28.670 2016.02.12 19:44  practice1 EURUSD,M5: BuyOrder:1.1237 closed at:1.1249 ordersLeft:12 equity:17614.5169 balance:24396.4067 freemargin:14223.4019 profit:118pips

2016.06.05 23:26:28.670 2016.02.12 19:44  practice1 EURUSD,M5: close #106 buy 1.00 EURUSD at 1.12371 at price 1.12489

2016.06.05 23:26:28.670 2016.02.12 19:43  practice1 EURUSD,M5: bid:1.1249 ask:1.1252 margin:3672.005 freemargin:13955.5119 balance:24278.4067 equity:17627.5169




 

The answer is starring you in the face:

2016.06.05 23:16:12.640 2016.02.15 15:18  practice1 EURUSD,M5: Order:1.1207 closed at:1.1177 orders:0 equity:414.4367 balance:414.4367 freemargin:-3818.1308 profit:-307pips


Don't just open 12 orders with 1.0 Lot just because you "believe" it is OK! Actually calculate your risk for both the margin/leverage as well as based on your stop loss for the entire basket of orders and also calculate where the margin call will take place.

So for EUR/USD, even when ignoring the Margin (Infinite Leverage), with 12 Orders at 1.0 Lot each, every order has merely to loose 83 pips each on average (or 1000 pips in total) and your ENTIRE balance of $10000 will be wiped out. Remember, each pip-lot is $10 for EUR/USD, so your balance is $10000/$10 = 1000 pip-lots = 12 lots x 83.333 pips.

Add to that the margin cost and you will reduce that distance VERY quickly.

  • At 1:500 Leverage, that will drop to an average of 63 pips (or 760 pips in total)
  • At 1:200 Leverage, that will drop to an average of 33 pips (or 400 pips in total)

In conclusion, calculate your risk and margin. Also, use a % risk that will allow you to continue trading even if you go through a LONG run of losses. Its called "trading", not "gambling".

 
last line
  • You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
  • Account Balance * percent = RISK = |OrderOpenPrice - OrderStopLoss| * OrderLots * DeltaPerlot (Note OOP-OSL includes the SPREAD)
  • Do NOT use TickValue by itself - DeltaPerlot
  • You must normalize lots properly and check against min and max.
  • You must also check FreeMargin to avoid stop out
Reason: