I am having problems with the SetTrailStop orders.
The code for testing the issue is just:
public class PruebaTrail : Strategy
{
#region Variables
// Wizard generated variables
private double trail = 300; // Default setting for Trail
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = true;
SetTrailStop(trail);
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
EnterLong();
}
I attach a image in which there is a trade and Trail Stop is working as a StopLoss of 300 € ( Image refer to Ibex35, where every point is 10€) I think It should exit the position before and with some profit instead of what the program is actually doing... Am I wrong?
Thanks!
Comment