Could anyone please add a fixed StopLoss to this ropot
Could anyone please add a fixed StopLoss to this ropot
14 Oct 2013, 18:48
Hi
This is not my robot, but i think it could be improved if it had a stop loss. I have tryed to add it my self, but i don't have any programing skilles.
Link to robot: /algos/robots/show/225
Thanks
Replies
gb1980be
18 Oct 2013, 23:51
Hi MRSV,
A good way to follow with your robot isn't to add a SL. Trust me.
Robot forex is a martingale. So your SL activated suppose that you arrive to the end of your 5th position opened without gain.
With a martingale robot, your robot will follow a way to the end of the max count positions settings (here is 5). And after ?
Imagine, the robot opened 5 positions (10k, 20k, 30k, 40k & 50k buy or sell). And after... the market never comes in the other way. You loose your money !
A good way to follow is to add something in the "controlseries" but not a SL.
In the control series, try to makes the robot, after your pipstep (300 here) overtaken, open a 6th position but in the other way with 70k of more to limit the loss.
And then, try to make your robot begin @ the startvolume.
If you do that, your robot will be a success.
private void ControlSeries() { int _pipstep, NewVolume, Rem; int BarCount = 25; int Del = MaxOrders - 1; if(PipStep == 0) _pipstep = GetDynamicPipstep(BarCount, Del); else _pipstep = PipStep; if(Account.Positions.Count < MaxOrders) switch(GetPositionsSide()) { case 0: if(Symbol.Ask < FindLastPrice(TradeType.Buy) - _pipstep * Symbol.PointSize) { NewVolume = Math.DivRem((int)(FirstLot + FirstLot*Account.Positions.Count), LotStep, out Rem) * LotStep; if(!(NewVolume < LotStep)) Trade.CreateBuyMarketOrder(Symbol, NewVolume); } break; case 1: if(Symbol.Bid > FindLastPrice(TradeType.Sell) + _pipstep * Symbol.PointSize) { NewVolume = Math.DivRem((int)(FirstLot + FirstLot*Account.Positions.Count), LotStep, out Rem) * LotStep; if(!(NewVolume < LotStep)) Trade.CreateSellMarketOrder(Symbol, NewVolume); } break; } }
Try to duplicate this serie (case 0 and case 1).
But inverse the Trade.CreateBuyMarketOrder to a Trade.CreateSellMarketOrder.
It is just a key for you to begin.
@gb1980be
jeex
18 Oct 2013, 17:16
It has a stoploss
I don't understand your question. The code you referred to (pasted up here) has a proper stoploss in the line
Could you be more specific, than i'll gladly be of assistance.
@jeex