My aim is to built a strategy which make few calculations on an instrument and based on few conditions enter Long to 2th instrument and enter Short to a 3th instrument( Actually I want to go Short in a basket of instruments).
To be more understandable lets say
Condition: EMA(5) > EMA(13) on EURUSD
Order: Enter Long on EURGBP
Condition EMA(5)< EMA(13) on EURUSD
Order: Close Long position and Enter Short on USDJPY
I have already made a code but when I going to back test it is not giving me any results. A part of my code is below
#region Variables
// Wizard generated variables
private string shortInst = @"USDJPY"; // Default setting for ShortInst
private string longInst = @"EURGBP"; // Default setting for LongInst
private string signalInst = @"EURUSD"; // Default setting for SignalInst
// User defined variables (add any user defined variables below)
#endregion
if (EMA(5)[0]>EMA(13)[0])
{
//Enter a long position on a basket of EM currencies
EnterShort(1,shortInst);
}
//Check if the momentum Fast EMA is lower than Slow EMA, change in trend
if ( EMA(5)[0]< EMA(13)[0])
{
ExitShort();
EnterLong(1,longInst);
}
Do you have any thoughs why this is not working? Thanks
Comment