I developped a strategy and tested it during month...
First on backtest to improve his performance , next on real-time but on simulated accound. (During one month)
With the good results I had , I decided last week to make the jump and begin to trade for real...
I had no problem the first two days with the strategy , but on third days I had cancelled orders...
I will just explain a little the strategy.
I trade on Futures , and have 4 different targets.
So for each enter , I create 4 orders and put Stop loss on each one...
The targets are managed by the strategy , I'm not using SetProfitTarget for now.
When a target is reached , I exit one order and modify the stop loss for thoses that stay...
The strategy can close positions but can also Reverse the positions...
And it's on that last case that I have a problem...
It seems it cannot reverse the StopLoss on real account (but it work on simulate account)
I will not show here the whole algorithm... It's my business
But The algorithm calls methods GoLong or GoShort in the OnBarUpdate depeinding of course of the logic.
I attach a code.txt file that contains the GoLong and GoShort method :
And I attach the log with the cancelled orders...
I think the problem comes by the fact that I change the stopLoss values before then EnterLong or EnterShort method...
But has I said , it runs like that on simulated account...
And I'm a little afraid to put the order EnterLong before giving good values to StopLoss
If the program crash between the two... I have order on the market without stopLoss...
Can you please explain me the best way to do that on real account ?
Thanks
Comment