How do i lower the volume per trade

Created at 04 Nov 2013, 17:41
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
OL

Old Account

Joined 14.10.2013

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.


@Old Account
Replies

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

Old Account
05 Nov 2013, 20:20

Thanks !


@Old Account