Bonjour,
Je viens d’essayer d’écrire quelques lignes, mais je bute sur un petit problème. Pour les jours où mon Trailing SL (0.75%) est touché, je voudrais que ProRealTime rachète 1 action juste avant la clôture entre 17h et 17h30. Autrement, je reste en position.
Par avance merci de votre aide.
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Prevents the system from placing new orders on specified days of the week
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
// Conditions to enter long positions
c1 = (close > 0)
IF c1 AND not daysForbiddenEntry THEN
BUY 1 SHARES AT MARKET
ENDIF
// Stops and targets
SET STOP %TRAILING 0.75
Dans ce cas il faudra lancer la stratégie dans un timeframe inférieur au journalier ou l’horaire de 17h30 est rencontré (UT 30minutes par exemple), à tester :
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Prevents the system from placing new orders on specified days of the week
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
// Conditions to enter long positions
c1 = (close > 0)
IF c1 AND not daysForbiddenEntry THEN
BUY 1 SHARES AT MARKET
ENDIF
if itnradaybarindex=0 or day<>day[1] then
trigger = 0
endif
if onmarket[1] and not onmarket then
trigger = 1
endif
if time = 173000 and c1 AND not daysForbiddenEntry and trigger then
BUY 1 SHARES AT MARKET
ENDIF
// Stops and targets
SET STOP %TRAILING 0.75
Merci infiniment Nicolas.