Only two trades per day
Created at 19 Jan 2014, 17:03
Only two trades per day
19 Jan 2014, 17:03
Hi guys. Can somebody help me with a code where only 2 trades per day are possible: Server.Time and...??
Replies
Cerunnos
19 Jan 2014, 18:54
RE:
Exactly :-) Thanks for your help
MRSV said:
Something like this?
private int _TradeCount; private int _TradeDay; protected override void OnStart() { _TradeCount = 0; } protected override void OnTick() { bool _TradeOk = _TradeCount <= 2; if (Server.Time.Day == _TradeDay + 1) _TradeCount = 0; if (......&& _TradeOk) { _TradeDay = Server.Time.Day; ExecuteMarketOrder(TradeType.Buy, Symbol, 1000); _TradeCount = _TradeCount + 1; } }
@Cerunnos
Old Account
19 Jan 2014, 18:07
Something like this?
@Old Account