Relatively new to C# and NT. I am trying to implement a simple example of scaling out of a position.
The example I'm using is a 5 lot initial position with a set stop of 15 ticks.
I want to exit out of the first position at a profit of 10 ticks, 2nd profit of 20 ticks, 3rd at 30 ticks and 4th at 40 ticks.
I would like to also use a trailing stop on the 5th position at 15 ticks when the position is up 40 ticks, not sure how to do that.
I would also like to set stops to Breakeven on all 5 when the first price target is hit at +10 ticks, not sure how to do that either.
I used the strategy builder.. The signal name for the initial stop loss of 15 ticks was generated on the SetStopLoss(@"" .
I wasn't sure if that syntax was correct and meant all positions of incorrect.
When I ran it it looked like it was basically working but received an error message on the orders that basically shut the strategy down.
I and trying to rerun to get the text of the error messaged,
Thank to anyone that can lend a hand?
Glen
SetProfitTarget(@"LE1", CalculationMode.Ticks, 10);
SetProfitTarget(@"LE2", CalculationMode.Ticks, 20);
SetProfitTarget(@"LE3", CalculationMode.Ticks, 30);
SetProfitTarget(@"LE4", CalculationMode.Ticks, 40);
SetStopLoss(@"", CalculationMode.Ticks, InitStop, false);
SetTrailStop(@"LE5", CalculationMode.Ticks, TStop, false);
/* ------Entry COndition Criteria met --------------------------------------------------------------------------------------------- */
{
EnterLong(Convert.ToInt32(DefaultQuantity), @"LE1");
EnterLong(Convert.ToInt32(DefaultQuantity), @"LE2");
EnterLong(Convert.ToInt32(DefaultQuantity), @"LE3");
EnterLong(Convert.ToInt32(DefaultQuantity), @"LE4");
EnterLong(Convert.ToInt32(DefaultQuantity), @"LE5");
Comment