KH
Topics
22 Nov 2017, 03:55
2722
5
06 Nov 2017, 08:50
1422
3
03 Nov 2017, 01:10
2973
7
Replies
khan_tu
06 Nov 2017, 09:28
if (rsi.Result.LastValue <= 30) { if (direction != 0) { foreach (var pos in Positions) { ClosePosition(pos); } PlaceLimitOrder(TradeType.Buy, Symbol, 10000, Symbol.Bid); // ExecuteMarketOrder(TradeType.Buy, Symbol, Quantity); // Close(TradeType.Sell); direction = 0; } } if (rsi.Result.LastValue >= 70) { if (direction != 1) { foreach (var Position in Positions) { ClosePosition(Position); } //Open(TradeType.Sell); //Close(TradeType.Buy); ExecuteMarketOrder(TradeType.Sell, Symbol, 10000); //ClosePosition(Position); direction = 1; } }
@khan_tu
khan_tu
22 Nov 2017, 20:51
RE:
Panagiotis Charalampous said:
The Problem Seems to be that its not running through the entire nested if statement, it runs through one or two, but doesnt read all of them
it enters positions it shouldnt because one conditin was true but the others werent for some reason
@khan_tu