Discussing the strategy VECTORIAL DAX (M5)

Viewing 15 posts - 1,246 through 1,260 (of 1,264 total)
  • Author
    Posts
  • #233241 quote
    SnorreDK
    Participant
    Junior

    I prefer Vectorial-US100-v2-WFE

    #234034 quote
    flipcash
    Participant
    Junior

    I prefer Vectorial-US100-v2-WFE

    you are using this one ?

    #234036 quote
    SnorreDK
    Participant
    Junior

    I prefer Vectorial-US100-v2-WFE

    you are using this one ?

    No i found this one thats for free trial right now.
    https://market.prorealcode.com/product/nordicalgos-dax5m/

    Im impressed so far

    #238887 quote
    Greger2346
    Participant
    Junior

    Here is a one for Dax 15m thats been live since February 2024 and has worked good for me.

    //————————————————————————-
    // Main code : DAX_15M_VECTORIAL_LIVE
    //————————————————————————-
    // M15
    // SPREAD 3
    // Optimize date – FEB 2024

    DEFPARAM CumulateOrders = false
    DEFPARAM Preloadbars = 50000

    // Variabler för handelstid
    ONCE zz = 36.0
    ONCE dd = 64.0
    ONCE bb = 41.0
    ONCE xx = 8.0
    CtimeA = time >= 080000 and time <= 220000
    CtimeB = time >= 080000 and time <= 220000
    ONCE BarLong = 350 // Avslutar lång position efter detta antal barer
    ONCE BarShort = 350 // Avslutar kort position efter detta antal barer

    // Positionstorlek
    ONCE PositionSizeLong = 0.5 // Storlek på lång position
    ONCE PositionSizeShort = 1 // Storlek på kort position

    // Strategi – Vektorberäkning av vinkel
    ONCE PeriodeA = xx // Period för exponentiellt glidande medelvärde (öka för mer stabilitet) (kortsiktig trend)
    ONCE nbChandelierA = zz // Antal ljus för vinkelberäkning (öka för att jämna ut beräkningen)

    MMA = Exponentialaverage[PeriodeA](close)
    ADJASUROPPO = (MMA – MMA[nbChandelierA] * pipsize) / nbChandelierA
    ANGLE = (ATAN(ADJASUROPPO)) // Beräkning av vinkel

    CondBuy1 = ANGLE >= 20 // Köpvillkor baserat på vinkel
    CondSell1 = ANGLE <= -45 // Säljvillkor baserat på vinkel

    // Vektorberäkning av lutning och dess glidande medelvärde
    ONCE PeriodeB = dd // Period för exponentiellt glidande medelvärde av lutning (öka för att fånga längre trender)
    ONCE nbChandelierB = bb // Antal ljus för lutningsberäkning (öka för att jämna ut beräkningen)

    lag = 6 // Fördröjning av signalen (öka för att fördröja signalen)

    MMB = Exponentialaverage[PeriodeB](close)
    pente = (MMB – MMB[nbChandelierB] * pipsize) / nbChandelierB
    trigger = Exponentialaverage[PeriodeB + lag](pente)

    CondBuy2 = (pente > trigger) AND (pente < 0) // Köpvillkor baserat på lutning
    CondSell2 = (pente CROSSES UNDER trigger) AND (pente > -1) // Säljvillkor baserat på lutning

    // Ingångar i position
    CONDBUY = CondBuy1 and CondBuy2 and CTimeA // Villkor för köp
    CONDSELL = CondSell1 and CondSell2 and CtimeB // Villkor för sälj

    // Lång position
    IF CONDBUY THEN
    buy PositionSizeLong contract at market
    SET TARGET %PROFIT 5.0 // Mål för vinst i procent
    ENDIF

    // Kort position
    IF CONDSELL THEN
    Sellshort PositionSizeShort contract at market
    SET TARGET %PROFIT 1.5 // Mål för vinst i procent
    ENDIF

    // Variabler för trailing stop
    ONCE trailingStopType = 1 // Trailing stop – 0 AV, 1 PÅ
    ONCE trailingstoplong = 10 // Trailing stop för lång position (öka för att skydda vinst)
    ONCE trailingstopshort = 7 // Trailing stop för kort position (öka för att skydda vinst)
    ONCE atrtrailingperiod = 30 // Period för ATR (justera för marknadsvolatilitet)
    ONCE minstop = 0.8 // Minsta avstånd för trailing stop (öka för större avstånd)

    // Trailing stop-logik
    atrtrail = AverageTrueRange[atrtrailingperiod]((close / 10) * pipsize) / 1000
    trailingstartl = round(atrtrail * trailingstoplong)
    trailingstartS = round(atrtrail * trailingstopshort)
    if trailingStopType = 1 THEN
    TGL = trailingstartl
    TGS = trailingstartS
    if not onmarket then
    MAXPRICE = 0
    MINPRICE = close
    PREZZOUSCITA = 0
    ENDIF
    if longonmarket then
    MAXPRICE = MAX(MAXPRICE, close)
    if MAXPRICE – tradeprice(1) >= TGL * pointsize then
    if MAXPRICE – tradeprice(1) >= minstop then
    PREZZOUSCITA = MAXPRICE – TGL * pointsize
    ELSE
    PREZZOUSCITA = MAXPRICE – minstop * pointsize
    ENDIF
    ENDIF
    ENDIF
    if shortonmarket then
    MINPRICE = MIN(MINPRICE, close)
    if tradeprice(1) – MINPRICE >= TGS * pointsize then
    if tradeprice(1) – MINPRICE >= minstop then
    PREZZOUSCITA = MINPRICE + TGS * pointsize
    ELSE
    PREZZOUSCITA = MINPRICE + minstop * pointsize
    ENDIF
    ENDIF
    ENDIF
    if onmarket and PREZZOUSCITA > 0 then
    EXITSHORT AT PREZZOUSCITA STOP
    SELL AT PREZZOUSCITA STOP
    ENDIF
    ENDIF

    // Exit zombie trade
    IF POSITIONPERF < 0 THEN
    IF shortOnMarket AND BARINDEX – TRADEINDEX(1) >= barshort THEN
    EXITSHORT AT MARKET
    ENDIF
    ENDIF

    IF POSITIONPERF < 0 THEN
    IF LongOnMarket AND BARINDEX – TRADEINDEX(1) >= barlong THEN
    SELL AT MARKET
    ENDIF
    ENDIF

    #238894 quote
    Maik2404
    Participant
    Veteran

    Ich bekomme folgende Fehler angezeigt

    I get the following errors

    Screenshot-2024-10-12-123050.png Screenshot-2024-10-12-123050.png
    #238897 quote
    robertogozzi
    Moderator
    Master

    @Maik2404

    Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.

    Thanks 🙂

    #238898 quote
    robertogozzi
    Moderator
    Master

    You are likely to have translated the code.

    Copy it without any translation.

    #238899 quote
    Maik2404
    Participant
    Veteran

    ok thanks, I’ll try it.

    #239038 quote
    VinzentVega
    Participant
    Veteran

    can you tell me what the backtest period was?

    #239046 quote
    sfl
    Participant
    Average

    Hi there,

    posizioneSize = 1 for both long & short.

    I’ll give it a try but I dont trust all these parameters with these precise values:

    ONCE zz = 36.0
    ONCE dd = 64.0
    ONCE bb = 41.0
    ONCE xx = 8.0

     

    How often do you optimize these params ?

    Screenshot-2024-10-16-alle-11.50.25.png Screenshot-2024-10-16-alle-11.50.25.png Screenshot-2024-10-16-alle-11.51.02.jpg Screenshot-2024-10-16-alle-11.51.02.jpg Screenshot-2024-10-16-alle-11.51.47.jpg Screenshot-2024-10-16-alle-11.51.47.jpg
    #239113 quote
    Greger2346
    Participant
    Junior

    What do you mean with positionsize = 1? The code have 0.5 when long and 1 when short.

    I havent optimized it since i started it in february.

    #239114 quote
    Greger2346
    Participant
    Junior

    Here you have the code with english comments:

    //————————————————————————-
    // Main code : DAX_15M_VECTORIAL_LIVE
    //————————————————————————-
    // M15
    // SPREAD 3
    // Optimize date – FEB 2024

    DEFPARAM CumulateOrders = false
    DEFPARAM Preloadbars = 50000

    // Variables for trading time
    ONCE zz = 36.0
    ONCE dd = 64.0
    ONCE bb = 41.0
    ONCE xx = 8.0
    CtimeA = time >= 080000 and time <= 220000
    CtimeB = time >= 080000 and time <= 220000
    ONCE BarLong = 350 // Closes long position after this number of bars
    ONCE BarShort = 350 // Closes short position after this number of bars

    // Position size
    ONCE PositionSizeLong = 0.5 // Size of long position
    ONCE PositionSizeShort = 1 // Size of short position

    // Strategy – Vector calculation of angle
    ONCE PeriodeA = xx // Period for exponential moving average (increase for more stability) (short-term trend)
    ONCE nbChandelierA = zz // Number of bars for angle calculation (increase to smooth out the calculation)

    MMA = Exponentialaverage[PeriodeA](close)
    ADJASUROPPO = (MMA – MMA[nbChandelierA] * pipsize) / nbChandelierA
    ANGLE = (ATAN(ADJASUROPPO)) // Angle calculation

    CondBuy1 = ANGLE >= 20 // Buy condition based on angle
    CondSell1 = ANGLE <= -45 // Sell condition based on angle

    // Vector calculation of slope and its moving average
    ONCE PeriodeB = dd // Period for exponential moving average of slope (increase to capture longer trends)
    ONCE nbChandelierB = bb // Number of bars for slope calculation (increase to smooth out the calculation)

    lag = 6 // Signal delay (increase to delay the signal)

    MMB = Exponentialaverage[PeriodeB](close)
    pente = (MMB – MMB[nbChandelierB] * pipsize) / nbChandelierB
    trigger = Exponentialaverage[PeriodeB + lag](pente)

    CondBuy2 = (pente > trigger) AND (pente < 0) // Buy condition based on slope
    CondSell2 = (pente CROSSES UNDER trigger) AND (pente > -1) // Sell condition based on slope

    // Entry conditions for positions
    CONDBUY = CondBuy1 and CondBuy2 and CTimeA // Buy conditions
    CONDSELL = CondSell1 and CondSell2 and CtimeB // Sell conditions

    // Long position
    IF CONDBUY THEN
    buy PositionSizeLong contract at market
    SET TARGET %PROFIT 5.0 // Profit target in percentage
    ENDIF

    // Short position
    IF CONDSELL THEN
    Sellshort PositionSizeShort contract at market
    SET TARGET %PROFIT 1.5 // Profit target in percentage
    ENDIF

    // Variables for trailing stop
    ONCE trailingStopType = 1 // Trailing stop – 0 OFF, 1 ON
    ONCE trailingstoplong = 10 // Trailing stop for long position (increase to protect profits)
    ONCE trailingstopshort = 7 // Trailing stop for short position (increase to protect profits)
    ONCE atrtrailingperiod = 30 // Period for ATR (adjust for market volatility)
    ONCE minstop = 0.8 // Minimum distance for trailing stop (increase for larger distance)

    // Trailing stop logic
    atrtrail = AverageTrueRange[atrtrailingperiod]((close / 10) * pipsize) / 1000
    trailingstartl = round(atrtrail * trailingstoplong)
    trailingstartS = round(atrtrail * trailingstopshort)
    if trailingStopType = 1 THEN
    TGL = trailingstartl
    TGS = trailingstartS
    if not onmarket then
    MAXPRICE = 0
    MINPRICE = close
    PREZZOUSCITA = 0
    ENDIF
    if longonmarket then
    MAXPRICE = MAX(MAXPRICE, close)
    if MAXPRICE – tradeprice(1) >= TGL * pointsize then
    if MAXPRICE – tradeprice(1) >= minstop then
    PREZZOUSCITA = MAXPRICE – TGL * pointsize
    ELSE
    PREZZOUSCITA = MAXPRICE – minstop * pointsize
    ENDIF
    ENDIF
    ENDIF
    if shortonmarket then
    MINPRICE = MIN(MINPRICE, close)
    if tradeprice(1) – MINPRICE >= TGS * pointsize then
    if tradeprice(1) – MINPRICE >= minstop then
    PREZZOUSCITA = MINPRICE + TGS * pointsize
    ELSE
    PREZZOUSCITA = MINPRICE + minstop * pointsize
    ENDIF
    ENDIF
    ENDIF
    if onmarket and PREZZOUSCITA > 0 then
    EXITSHORT AT PREZZOUSCITA STOP
    SELL AT PREZZOUSCITA STOP
    ENDIF
    ENDIF

    // Exit zombie trade
    IF POSITIONPERF < 0 THEN
    IF shortOnMarket AND BARINDEX – TRADEINDEX(1) >= barshort THEN
    EXITSHORT AT MARKET
    ENDIF
    ENDIF

    IF POSITIONPERF < 0 THEN
    IF LongOnMarket AND BARINDEX – TRADEINDEX(1) >= barlong THEN
    SELL AT MARKET
    ENDIF
    ENDIF

    blondmartin thanked this post
    #239119 quote
    sfl
    Participant
    Average

    I know but I changed to 1 for both long and short, my backtest was done with this value.

    ciao

    #239131 quote
    Greger2346
    Participant
    Junior

    Ahh then i understand 🙂

    Regarding you comment about precise parameters, you can also test with even numbers and you still get “ok” results with a good equity curve.

    Example:
    ONCE zz = 40.0
    ONCE dd = 60.0
    ONCE bb = 40.0
    ONCE xx = 8.0

    Test1.png Test1.png
    #239137 quote
    sfl
    Participant
    Average

    Regarding you comment about precise parameters, you can also test with even numbers and you still get “ok” results with a good equity curve.

    Optimizing is ok but the point is how often are you going to re-optimize the system ?

    I am testing it live but based on the backtest results you need to run it for 3-6 months at least before doing any evaluation since it’s not very active (less than 1 trade a day on average)

    thank you ciao

Viewing 15 posts - 1,246 through 1,260 (of 1,264 total)
  • You must be logged in to reply to this topic.

Discussing the strategy VECTORIAL DAX (M5)


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Balmora74 @balmora74 Participant
Summary

This topic contains 1,263 replies,
has 125 voices, and was last updated by VinzentVega
1 year ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/24/2019
Status: Active
Attachments: 470 files
Logo Logo
Loading...