Stratégie sur niveaux de prix clés NASDAQ

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #244910 quote
    Laurent 31190
    Participant
    New

    Bonjour à tous, je suis novice dans le code et souhaiterais avoir de l’aide pour coder la stratégie que j’ai en tête concernant des prises de positions à l’achat sur des niveaux de prix clés sur le NASDAQ.

    •⁃Les niveaux de prix sont les suivants (tous les prix ENTIERS se terminant par 000 , 00, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950.

    je souhaite que le code identifie un rebond en vérifiant qu’un des niveaux clés à été croisé à la BAISSE et ensuite prendre la position à l’achat lorsque que le prix re-croise ce même niveau à la HAUSSE.

    Il faudrait ensuite gérer la position de 2 manières selon les cas suivant :

    Cas n° 1 : Le prix évolue à la hausse, et ATTEINT un objectif de gain minimum de X points, si cet objectif est atteint on accompagne la position afin d’optimiser les gains.

    Cas n° 2 : Le prix évolue à la hausse, et N’ATTEINT PAS le gain minimum de X points, alors on ferme la position flat ou avec un stop Loss de X points.

    Merci d’avance pour votre aide.

    #244927 quote
    JS
    Participant
    Senior

    Salut, essaie celui-ci…

    DefParam CumulateOrders=False
    
    // Parameters
    X = 900  // Minimum gain target and stop loss in points
    
    // Identify key levels (whole numbers ending in 000, 50, 100, etc.)
    keyLevel = round(close / 50) * 50
    
    // Detect downward cross
    crossedDown = (close[1] > keyLevel AND close < keyLevel)
    
    // Detect upward re-cross
    crossedUp = (close[1] < keyLevel AND close > keyLevel)
    
    // Entry condition
    if crossedDown then
    levelTracked = keyLevel  // Store the crossed level
    endif
    
    if crossedUp AND levelTracked = keyLevel then
    buy 1 contract at market
    entryPrice = close
    targetPrice = entryPrice + X
    stopLoss = entryPrice - X
    endif
    
    // Position Management
    if longonmarket then
    if high >= targetPrice then
    // Target reached, optimize position (e.g., move stop to breakeven or trail)
    stopLoss = max(stopLoss, entryPrice)
    elsif close <= stopLoss then
    sell at market
    endif
    endif
    Scherm­afbeelding-2025-03-14-om-16.24.53.png Scherm­afbeelding-2025-03-14-om-16.24.53.png
    #244929 quote
    Laurent 31190
    Participant
    New

    Bonjour,

    Merci Js je vais tester ça

    Bonne journée.

    JS thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Stratégie sur niveaux de prix clés NASDAQ


ProOrder : Trading Automatique & Backtests

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Laurent 31190
11 months, 3 weeks ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 03/13/2025
Status: Active
Attachments: 1 files
Logo Logo
Loading...