I'm struggling when trying to use entry price to calculate targets & stops
Please can you help
I'm trying to use something like
if (Position.MarketPosition == MarketPosition.Long)
{
SetStopLoss(CalculationMode.Price, Low[2]);
SetProfitTarget(CalculationMode.Price, (Position.AveragePrice + (Position.AveragePrice - Low[2])));
}
If I have it in the state.configure section I'm getting the below error in the console, not when building
Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.
If I place it in on bar update it's clearly not doing what I want it to
I also want to use something like
if (Position.MarketPosition == MarketPosition.Short)
{
SetStopLoss(CalculationMode.Price, Swing(5).SwingHigh[0]);
SetProfitTarget(CalculationMode.Price, (Position.AveragePrice - (Position.AveragePrice + Swing(5).SwingHigh[0])));
}
I think you can see the kind of thing I'm trying to do a previous price value to create a stop & then use that to calculate the target.
Any help would be great please, I've searched through the forum & found some good posts, just cant get it working sorry
Thanks
Gav

Comment