Have some code that will close all positions once equity reaches a certain level above account balance which works. However I have additional code to open more trades but nothing happens after the original open trades have been closed. Not sure what I am missing here so any help appreciated.
if (Account.Equity > (Account.Balance + (Account.Balance * (Profiteer / 100))))
foreach (var openedPosition in Positions)
{
ClosePosition(openedPosition);
}
if (_stochastic.PercentK.Last(2) > _stochastic.PercentD.Last(2) && _stochastic.PercentK.Last(1) < _stochastic.PercentD.Last(1))
{
Print("_stochastic.PercentD.Last(1) {0}", _stochastic.PercentD.Last(1));
Print("_stochastic.PercentD.Last(2) {0}", _stochastic.PercentD.Last(2));
if (_stochastic.PercentD.Last(2) > Up_Level && _stochastic.PercentK.Last(2) > Up_Level)