Close Positions Immediately
Created at 18 Jun 2014, 12:13
Close Positions Immediately
18 Jun 2014, 12:13
I need some guidance on how to close position immediately and not on the next open bar. I have tested my code in both OnTick and OnBar, but the effect stays the same. The time frame I use is 1 hour.
Code:
if (longPosition != null && _cciclose.Result.Last(1) < 0 && valueClose <= valueMa)
{
ClosePosition(longPosition);
Thanks
breakermind
18 Jun 2014, 12:33
RE:
davidp13 said:
Hi,
set OnTick when tick change then close all positions
if the tick does not change it, nothing happens, set yourself on the chart period 1tick and see how it works(in the evening when there is little traffic), everything changes for the tick
tick is the smallest interval - probably
so I explain it myself.
Regards
@breakermind