I programmed the following strategy into the wizard
ParobolicSar:CrossBelow(ParabolicSAR(0.02,0.2,0.02), Low,1))
EnterLong(DefaultQuantity,"");
CrossAbove(ParabolicSAR(0.02,0.2,0.02), High,1))
EnterShort(DefaultQuantity,"");
SetStopLoss("", CalculationMode.Ticks,15,true);
But I would like to add a target as follows:
Target 1: 25 points: if these 25 points are not reached, the position should close at target 2.
Target 2: 20 points: if these 20 points are not reached, the position should close at target 3.
Target 3: 15 points: if these 15 points are not reached, the position should close at target 4.
Target 4: 10 points: if these 10 points are not reached, the position should close at target 5.
Target 5: 5 points: if these5 points are not reached, the position should close at target 6.
Target 6: 2 points if these 2 points are not reached, close at change of SAR.
Anather possibility, a tralingstop, but that may only start as my position has reached 7 points in de good direction.
Could someone explain how to add this target and at what location in the strategy.
Harry Hintzen
#regionVariables
// Wizard generated variables
privateintmyInput0 = 1; // Default setting for MyInput0
// 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>
protectedoverridevoidInitialize()
{
Add(ParabolicSAR(0.02, 0.2, 0.02));
Add(ParabolicSAR(0.02, 0.2, 0.02));
SetStopLoss("", CalculationMode.Ticks, 15, true);
CalculateOnBarClose = true;
}
///<summary>
///Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoidOnBarUpdate()
{
// Condition set 1
if(CrossBelow(ParabolicSAR(0.02, 0.2, 0.02), Low, 1))
{
EnterLong(DefaultQuantity, "");
}
// Condition set 2
if(CrossAbove(ParabolicSAR(0.02, 0.2, 0.02), High, 1))
{
EnterShort(DefaultQuantity, "");
}
}

Comment