Build 111 - Restesting SQ3 strategy gives completely different results

Hi,



I retested an SQ3 strategy (attached) with the same TickStory data, the results are 100% different. Equity curve is all over the place.


The pseudo code of the strategy looks odd:


//--------------------------------------------------------------------
// Pseudo Source Code of Strategy 0.3638
//
//   Generated by StrategyQuant X Build 111 for MetaTrader
//   at 09/25/2018 21:06
//--------------------------------------------------------------------


//--------------------------------------------------------------------
//  Strategy Parameters
//--------------------------------------------------------------------
int MagicNumber = 12345;
bool ReplaceExistingOrders = true;


Main chart = Current Symbol / Current TF


//--------------------------------------------------------------------
// Trading rule: Long Entry (On Bar Open)
//--------------------------------------------------------------------                   
if (No Trade Recently Closed
   and (Stochastic(Main chart,9, 3, 20).Slow%D[1] < 50))
{
    // Action #1
    Open Long order at (SMA(Main chart,2)[1] + (-0.6 * BarRange(Main chart)[43])) Stop;
        Order valid for 100 bars;
        Stop Loss = 140 pips;
        Profit target = 200 pips;


        Trailing Stop = (EMA(Main chart,40)[1] + (0 * ConvertToRealPips("Current", 59.0)));
        Trailing Stop Activation = -5000000 pips;


        Exit After 40 bars;


}




//--------------------------------------------------------------------
// Trading rule: Short Entry (On Bar Open)
//--------------------------------------------------------------------                   
if (No Trade Recently Closed
   and (Stochastic(Main chart,9, 3, 20).Slow%D[1] > 50))
{
    // Action #1
    Open Short order at (SMA(Main chart,2)[1] + (0.6 * BarRange(Main chart)[43])) Stop;
        Order valid for 100 bars;
        Stop Loss = 140 pips;
        Profit target = 200 pips;


        Trailing Stop = (EMA(Main chart,40)[1] + (0 * ConvertToRealPips("Current", 59.0)));
        Trailing Stop Activation = -5000000 pips;


        Exit After 40 bars;


}




//--------------------------------------------------------------------
// Trading rule: Long Exit (On Bar Open)
//--------------------------------------------------------------------                   
if ((MarketPosition("Current", MagicNumber, "") is Long))
{
}




//--------------------------------------------------------------------
// Trading rule: Short Exit (On Bar Open)
//--------------------------------------------------------------------                   
if ((MarketPosition("Current", MagicNumber, "") is Short))
{
}








Thanks,


Mike

Attachments
Strategy 03638.str
(1.50 MiB)
  • Votes 0
  • Project StrategyQuant X
  • Type Bug
  • Status Refused
  • Priority Low

History

m
#1

mikeyc

25.09.2018 23:12

Task created

TB
#2

Tomas Brynda

10.04.2019 13:13

Status changed from New to Refused

I backtested the attached strategy in both SQ3 and SQX. The differences are caused by a different implementation of Stochastic indicator. 

In old SQ, a non-standard implementation was used and it was the same algorithm as in a built-in metatrader Stochastic indicator.


In SQX we've decided to use standardized implementations of indicators. If you need to get the same results as in SQ3, you would have to add a new Java snippet of Stochastic indicator using the old agorithm.


Votes: 0

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please