Simple 20-point Grid for DAX (Long Only)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #256525 quote
    Biloute62
    Participant
    Junior

    I am sharing a raw grid code I used on the DAX m1 timeframe during the last bullish leg.


    The logic is stupidly simple: It buys 1 contract every time price drops by 20 points from the last trade price. It closes everything when the total profit reaches a fixed target (Global Target).


    I know grids are dangerous, but if you run this only during US market hours and cut it before the close, it acts as a liquidity provider.

    Be careful with the leverage, on the DAX it can go fast. I set the max positions to 10 to avoid blowing the account.


    // --------------------------------------------------------
    // Strategy: Simple Accumulation Grid (Long Only)
    // Asset: DAX / Indices
    // Risk: HIGH - No Stop Loss per trade
    // --------------------------------------------------------
    
    
    DEFPARAM CumulateOrders = True // Essential for Grid
    
    
    // Settings
    GridStep = 20        // Distance between buys
    TakeProfitPoints = 50 // Target in points (Global)
    MaxPositions = 10    // Safety limit
    
    
    // Entry Logic
    IF Not OnMarket THEN
        BUY 1 CONTRACT AT MARKET
        LastEntryPrice = Close
    ENDIF
    
    
    // Add to Grid (Averaging Down)
    IF LongOnMarket AND CountOfPosition < MaxPositions THEN
        IF Close <= LastEntryPrice - GridStep THEN
            BUY 1 CONTRACT AT MARKET
            LastEntryPrice = Close // Update reference price
        ENDIF
    ENDIF
    
    
    // Exit Logic (Global Profit Target)
    // We calculate the average entry price of the whole stack
    AvgPrice = PositionPrice
    CurrentProfit = (Close - AvgPrice) * CountOfPosition
    
    
    IF CurrentProfit >= (TakeProfitPoints * PointValue) THEN
        SELL AT MARKET
    ENDIF
    
    Nicolas and robertogozzi thanked this post
    #256527 quote
    Biloute62
    Participant
    Junior

    It’s not too bad that the trend is clear (long only on indices)… Of course, be wary of Trump as soon as the US wakes up!

    grid-DAX-1-minute-scaled.png grid-DAX-1-minute-scaled.png
    #256760 quote
    Nicolas
    Keymaster
    Master

    This is below another version, tested for recent NASDAQ data 5-minutes, 0.5 contracts, 1 point spread.

    Added a trend filter (simple couple of long term SMA comparison) plus another exit when in profit / breakeven in grid situation.

    There is a whole range of things to explore for this kind of strategies! Lots of maths and headaches, but hey we like this so much! šŸ™‚

    // --------------------------------------------------------
    // Strategy: Simple Accumulation Grid (Long Only)
    // Risk: HIGH - No Stop Loss per trade
    // --------------------------------------------------------
    
    
    DEFPARAM CumulateOrders = True // Essential for Grid
    
    
    // Settings
    GridStep = 20        // Distance between buys
    TakeProfitPoints = 50 // Target in points (Global)
    MaxPositions = 10    // Safety limit
    
    
    sma1=average[200]
    sma2=average[400]
    uptrend = sma1>sma2 
    
    
    // Entry Logic
    IF Not OnMarket and uptrend THEN
    BUY 1 CONTRACT AT MARKET
    LastEntryPrice = Close
    ENDIF
    
    
    // Add to Grid (Averaging Down)
    IF LongOnMarket AND CountOfPosition < MaxPositions and not uptrend THEN
    IF Close <= LastEntryPrice - GridStep THEN
    BUY 0.5 CONTRACT AT MARKET
    LastEntryPrice = Close // Update reference price
    ENDIF
    ENDIF
    
    
    // Exit Logic (Global Profit Target)
    // We calculate the average entry price of the whole stack
    AvgPrice = PositionPrice
    CurrentProfit = (Close - AvgPrice) * CountOfPosition
    
    
    IF (CurrentProfit >= (TakeProfitPoints * PointValue)) OR (CurrentProfit>0 and countofposition>1) THEN
    SELL AT MARKET
    ENDIF
    


    nasdaq-grid-strategy-5-minutes.png nasdaq-grid-strategy-5-minutes.png
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

šŸ“ā€ā˜ ļø The Dark Side: Grids & Martingales

New Reply
Author
author-avatar
Biloute62 @biloute62 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Nicolas
1 month ago.

Topic Details
Forum: šŸ“ā€ā˜ ļø The Dark Side: Grids & Martingales Forum
Started: 01/20/2026
Status: Active
Attachments: 2 files
Logo Logo
Loading...