what i am trying to do is have a stop then after a certian amount of ticks it will convert to a trailing stop.
the third condition is if the user double clicks it will cancell the trailing stop and set a hard stop so the user can move it freely.
///condition flat
if(bRedBar == true && nCount == 0)
{
if(Close[0] > Open[0] + 5*TickSize)
{
EnterShortStopMarket(nNumberOfSetContracts, nEntryPrice, "Short1");
SetStopLoss("Short1", CalculationMode.Ticks, 11, false);
SetProfitTarget("Short1", CalculationMode.Ticks, 10);
EnterShortStopMarket(nNumberOfContractsRunner,nEnt ryPrice,"Short2");
SetStopLoss("Short2", CalculationMode.Ticks, 11, false);
nCount = 0;
}
if(Position.MarketPosition == MarketPosition.Long && Position.Quantity == 1)
{
if(bRedBar == true && nCount ==0)
{
if(Close[0] > Open[0] + 5*TickSize)
{
EnterShortStopMarket(nNumberOfSetContracts, nEntryPrice, "Short1");
SetStopLoss("Short1", CalculationMode.Ticks, 11, false);
SetProfitTarget("Short1", CalculationMode.Ticks, 10);
if(bTrailStopSet == false)
{
SetTrailStop("Short2", CalculationMode.Ticks, 18, false);
bTrailStopSet = true;
}
nCount ++;
}
if(bManualStopMovement == true && bManualStopOverride == false )
{
SetStopLoss("Short2", CalculationMode.Ticks, 18, false);
bManualStopOverride = true;
}
}
}
Comment