I created a strategy using in OnBarUpdate the following two:
-------------------------------------------------------------
protected override void Initialize()
{
CalculateOnBarClose = true;
}
--------------------------------------------------------------
if (Position.MarketPosition == MarketPosition.Flat){
SetStopLoss(CalculationMode.Ticks, 3);
SetProfitTarget(CalculationMode.Ticks, 4); }
--------------------------------------------------------------
1#When the strategy enters Long/Short (in replay), I would like to manually change stoploss/target in the Dome. This works as long as price is moving within the same bar. As soon as a new bar formes, it resets itself to the above settings even when I'm in a position?!
How come? Any suggestions how to solve this ?
ps 2# If using SetStopLoss & SetProfitTarget, is that created as bracket or oco or ... ?
3# I also noticed that Position.MarketPosition == MarketPosition.Long or short is seen as Flat until the next bar creation begins ? How come?
Hope you can help me out here,
Thanks in advance,
Greetings from the netherlands,
Comment