OL
How do i lower the volume per trade
04 Nov 2013, 17:41
Hi, I'm wondering if anyone knows how you lower the volume of the next trade, and then make it restart form the starter volume after one trade hit the stop loss .
So if it start at 100k the next would be 90k, 80k and so on down to 10k, after a 10k trade is hit it makes another 10k until a stop loss is hit, then it goes back to 100k
Thanks.

jeex
05 Nov 2013, 18:16
two variables
Keep track of the current volume:
private int curVol; private int maxVol = 100; protected override void OnStart() { curVol = maxVol; } protected override void OnPositionOpened(Position p) { curVol = curVol - 10; } protected override void OnPositionClosed(Position p) { if (curVol <= 10) curVol = maxVol; }@jeex