I have to move the StopLoss to EntryPrice, when the position moves into profit.
For example, Buy $ 10.
StopLoss, 4%.
If the price go to $ 11 The StopLoss move to Entryprice (10 $).
Code:
#region Positions
private void GoLong()
{
SetStopLoss(CalculationMode.Percent,0.04);
EnterLong(100, "");// 10$
}
#endregion
#region OrderRouting
private void ManagerOrder ()
{
if (Position.MarketPosition == MarketPosition.Long )
{if( High[0] > Position.AvgPrice *(1+0.03)))
SetStopLoss("°", CalculationMode.Price,Position.AvgPrice, true);
Print(Time[0]+Position.AvgPrice);// the value of the Output Window is ( 0 ), instead of 10$.

Why?
Ciao.
Roberto


Comment