Bonjour, j'ai quelques questions concernant le code que je colle ci-dessous. J'ai utilisé Algowizard pour créer un modèle pour une stratégie simple de cassure du canal de Donchian. Voici mes questions :
-Je comprends le StopLossCoef - c'est ainsi que mon stop loss est calculé. Mais qu'est-ce que
//——————————————————————–
// Pseudo-code source de la stratégie 0.312
//
// Généré par StrategyQuant X Build 142 pour MetaTrader
// au 03/12/2025 16:03
//
// Backtested on _M6E.B / D1, 1999.01.04 - 2014.12.31
// Moteur de backtest : Tradestation
//——————————————————————–
//——————————————————————–
// Paramètres de la stratégie
//——————————————————————–
int MagicNumber = 11111 ;
double SSM = 1 ;
double LSM = 1 ;
int Période1 = 150 ;
int Période2 = 140 ;
int Période3 = 170 ;
int Période4 = 40 ;
double AssignVrbVleEntMlt1 = 7.5 ;
double StopLossCoef1 = 2.1 ;
double AssignVrbVleEntMlt2 = 3 ;
Graphique principal = Symbole actuel / TF actuelle ;
//——————————————————————–
// Logique des options de trading
//——————————————————————–
Ne pas négocier le week-end = faux (vendredi 0038 - dimanche 0038) ;
Sortie en fin de journée = faux (2304) ;
Sortie le vendredi = faux (2200) ;
LimitSignalsTimeRange = false (0800 - 1600, Exit at End : false, Orders to close : All) ;
LimitMaxDistanceFromMarketPrice = false ; //Limiter la distance maximale
MaxDistanceFromMarketPct = 6 ; //Distance maximale %
MaxTradesPerDay = 1 ;
Min SL : 0, Max SL : 0, Min PT : 0, Max PT : 0 ; // en ticks/pips, 0 signifie illimité
//——————————————————————–
// Règle de trading : Signaux de trading (à l'ouverture de la barre)
//——————————————————————–
LongEntrySignal = ((Close(Main chart)[0] > Highest(Main chart, Period1, PRICE_CLOSE)[1])
et (Close(Main chart)[1] < Highest(Main chart, Period1, PRICE_CLOSE)[2])) ;
LongExitSignal = (Close(Main chart)[0] < Lowest(Main chart, Period2, PRICE_CLOSE)[1]) ;
ShortEntrySignal = ((Close(Main chart)[0] < Lowest(Main chart, Period3, PRICE_CLOSE)[1])
et (Close(Main chart)[1] > Lowest(Main chart, Period3, PRICE_CLOSE)[2]) ;)
ShortExitSignal = (Close(Main chart)[0] > Highest(Main chart, Period4, PRICE_CLOSE)[1]) ;
//——————————————————————–
// Règle de trading : Entrée longue (à l'ouverture de la barre)
//——————————————————————–
si ((LongEntrySignal
et Non ShortEntrySignal)
et Non LongExitSignal)
{
// Action #1
LSM = AssignVrbVleEntMlt1 ;
// Action #2
Ouvrir un ordre long au marché ;
Métiers en double : désactivé ;
Stop Loss = StopLossCoef1 * ATR(20) ;
}
//——————————————————————–
// Règle de trading : Entrée courte (à l'ouverture de la barre)
//——————————————————————–
si ((ShortEntrySignal
et Non LongEntrySignal)
et Non ShortExitSignal)
{
// Action #1
SSM = AssignVrbVleEntMlt2 ;
// Action #2
Commande courte ouverte au marché ;
Métiers en double : désactivé ;
Stop Loss = StopLossCoef1 * ATR(20) ;
}
//——————————————————————–
// Règle de trading : Sortie longue (à l'ouverture de la barre)
//——————————————————————–
si (LongExitSignal
et (MarketPosition("Current", MagicNumber, "") is Long))
{
// Action #1
Close Full position for Symbol = Current and Magic Number = MagicNumber ;
}
//——————————————————————–
// Règle de trading : Sortie courte (à l'ouverture de la barre)
//——————————————————————–
si (ShortExitSignal
et (MarketPosition("Current", MagicNumber, "") is Short))
{
// Action #1
Close Full position for Symbol = Current and Magic Number = MagicNumber ;
}
Broker : Pas de filtre