Okay I developed a signal indicator which work fine. I would like to code strategy based on this indicator. So I developed everything this morning, but when I lauch the strategy on my graph nothing happens. What's wrong ?
(I simplify the code with "BuySignal" / "SellSignal" etc... The problem isn't here as my indicator works, I think the issue is linked to order operation.)
// Condition set 1
if (BuySignal == 1)
{
EnterLong(2, "Achat");
}
// Condition set 2
if (SellSignal== 1)
{
EnterShort(2, "Vente");
}
// Condition set 3
if (StopSignal== 0.5)
{
ExitLong("", "");
ExitShort("", "");
}
// Condition set 4
if (TargetSignal== 0.75
&& Position.MarketPosition == MarketPosition.Long)
{
ExitLong(1, 1, "Exit Long Position", "Achat");
}
// Condition set 5
if (TargetSignal== 0.75
&& Position.MarketPosition == MarketPosition.Short)
{
ExitShort(1, 1, "Exit Short Position", "Vente");
}

Comment