Mother of Dragons trading strategy…

Viewing 15 posts - 346 through 360 (of 523 total)
  • Author
    Posts
  • #140469 quote
    VinzentVega
    Participant
    Veteran

    Does anyone know of any reason why one shouldn’t trade with this enabled?

    Maybe the reason is, that the profit/equity curve for a longer period is not better than without cumulation. Other reason could be a higher DD,but I can´check it, because my longest period in 5m TF is only 15 month.

    #140496 quote
    GraHal
    Participant
    Master

    Does anyone know of any reason why one shouldn’t trade with this enabled?

    Would be scary if one morning you woke up and the System had accumulated 20 trades (position size is 20)  and you were close to  or on a margin call??

    #140641 quote
    deletedaccount051022
    Participant
    New

    Thank you VinzentVega and GraHal for your feedback.  Whilst the extensive parameters required to generate a signal mean that there don’t appear to be many triggered, the point of waking up to 20 positions on at once remains a reality.

    I found this post by Vonasi which I shall incorporate into the latest version to negate the risk and set a max position allowed;

    https://www.prorealcode.com/topic/using-true-cumulating-positions/#post-97661

    Thanks again everyone, much appreciated.

    #140889 quote
    scoot3r83
    Participant
    Average

    I’m recently new to this thread and have read over all the content and quite impressed on what has been put together in this strategy. I ran a few versions (as below) on my IG demo account and am pleased with the results so far, 6 wins and 2 losses. The two losses were also quite minimal especially in comparison to the gains made on the winning trades. I wanted to ask you all of which charts each of these should be getting loaded into. Have I loaded these to the correct charts?

    DAX MoD V2.2a Loaded On 5 Min Germany 30 Cash (5 EURO) i.e. not the futures.

    DOW MoD V4.7 Loaded On  5 Min DJI Wall Street Cash ($10) DOW Main

    DJ MoD V4.7a Loaded On  5 Min DJI Wall Street Cash ($10) DOW Main

    I noticed there is also a NAS Version of NAS MoD V3. Is this to be loaded onto the USTech 100 ($1) NASDAQ Futures?

    #141333 quote
    pat95162
    Participant
    Junior

    Hello, do you have the same thing as me?

    motherOfDragon.png motherOfDragon.png
    #141362 quote
    Nicolas
    Keymaster
    Master

    @pat95162

    English only in this topic please!

    #142398 quote
    scoot3r83
    Participant
    Average

    No, I have had mine on Wall Street Cash A$1 with these results. I have been quite impressed. This backtest was done with 10 x $1 contracts and 1 pip spread but the number of contracts is up to your own risk plan/management.

    DJI-Backtest-20200824.png DJI-Backtest-20200824.png
    #142401 quote
    scoot3r83
    Participant
    Average

    I have been testing these MoD algos with a few colleagues, with some other commercial algorithms we had headaches regarding time zone settings needing to be set in a particular country/time zone or they would not work. The procedure when loading could not use the individual exchange time zones but we needed to change the time zone for PRT completely whilst loading the algorithm.

    When using the DAX V2.2a, DJI V4.7a and NAS V3 algorithms, which time zone settings are required?


    @nonetheless
    @dowjones Am tagging you guys as you had posted the versions of the strategy that I am using.

    #142411 quote
    Dow Jones
    Participant
    Veteran

    DAX V2.2a, DJI V4.7a and NAS V3 algorithms, which time zone settings are required?

    DAX V2.2a = UTC + 2

    DJI V4.7.2a = UTC + 8

    I didn’t use NAS, so I’m not sure…

    scoot3r83 thanked this post
    #145991 quote
    christofferR
    Participant
    Average

    Hi all,

    Iv’e tried to use the Mother of Dragons for setting up a system for Brent. Im wondering if anyone else have a system running that isn’t stopped on a regular basis?

    The error message is:
    “The trading system was stopped due to a division by zero during the evaluation of the last candlestick. You can add protections to your code to prevent divisions by zero then backtest the system to check the correction.”

    Found a old post about this regarding one or two value RSI and ghost bars but can’t seem to figure out what would cause it since the RSI is above

    After a lot of trial and error im not 100% who to credit for the code and there for the header misses correct credits. Sorry for that but a lot of thanks for the work everybody put in to this and thanks for sharing!

     

     

    // Definition of code parameters
    DEFPARAM CumulateOrders = false // Cumulating positions deactivated
    DEFPARAM preloadbars = 10000
    //Money Management
    MM = 0 // = 0 for optimization
    if MM = 0 then
    positionsize = 1
    ENDIF
    
    //code re-invest
    Capital = 1000 // initial capital
    Equity = Capital + StrategyProfit
    
    if MM = 1 then
    
    positionsize = Max(1, Equity * (1/Capital))
    positionsize = Round(positionsize*100)
    positionsize = positionsize/100
    // change from "1" to "position" in buy/sell conditions to use re-invest
    //********************
    ENDIF
    
    //code quit strategy
    maxequity = max(equity,maxequity)
    DrawdownNeededToQuit = 20  // percent drawdown from max equity to stop strategy
    
    if equity < maxequity * (1 - (DrawdownNeededToQuit/100)) then
    quit
    endif
    
    
    
    // Time management
    Ctime = not (time >= 205959 or time < 070000)
    // Friday 22:00 Close ALL operations.
    IF DayOfWeek = 5 AND time = 220000 THEN
    SELL AT MARKET
    EXITSHORT AT MARKET
    ENDIF
    
    // Settings
    //Timeframe 2h
    //Period weightedaverage
    Q1 = 44 // 1-600
    //Supertrend
    q2 = 6 // 1 - 10
    q3 = 6 // 1- 10
    // MA average
    q4 = 7 // 1- 100
    q5 = 4 // 0-6
    // RSI
    q6 = 20
    q7 = 10
    q8 = 6
    q9 = 2
    // 30 min
    // Average
    q10 = 2 // 1- 10
    q11 = 5 // 1- 10
    // 15 min
    // Average
    q12 = 3 // 1- 10
    q13 = 4 // 1- 10
    // Periodc
    q14 = 42
    // 10 min
    // supertrend
    q15 = 2 //na
    q16 = 7 // na
    // 5 min
    //RSI
    q17 = 8
    q18 = 3
    q19 = 12
    q20 = 11
    //ma average
    q21 = 17
    q22 = 5
    //Periodb
    q23 = 17
    
    //Long SL
    q24 = 7
    //Long TP
    q25 = 9
    //Short SL
    q26 = 7
    //Short TP
    q27 = 9
    
    
    
    
    
    TIMEFRAME(2 hours,updateonclose)
    Period= Q1
    inner = 2*weightedaverage[round( Period/2)](typicalprice)-weightedaverage[Period](typicalprice)
    HULLa = weightedaverage[round(sqrt(Period))](inner)
    c1 = HULLa > HULLa[1]
    c2 = HULLa < HULLa[1]
    
    indicator1 = SuperTrend[q2,q3]
    c3 = (close > indicator1)
    c4 = (close < indicator1)
    
    ma = average[q4,q5](close)
    c11 = ma > ma[1]
    c12 = ma < ma[1]
    
    //Stochastic RSI | indicator
    lengthRSI = q6 //RSI period
    lengthStoch = q7 //Stochastic period
    smoothK = q8 //Smooth signal of stochastic RSI
    smoothD = q9 //Smooth signal of smoothed stochastic RSI
    myRSI = RSI[lengthRSI](close)
    MinRSI = lowest[lengthStoch](myrsi)
    MaxRSI = highest[lengthStoch](myrsi)
    StochRSI = (myRSI-MinRSI) / (MaxRSI-MinRSI)
    K = average[smoothK](stochrsi)*100
    D = average[smoothD](K)
    c13 = K>D
    c14 = K<D
    
    TIMEFRAME(30 minutes,updateonclose)
    indicator5 = Average[q10](typicalPrice)
    indicator6 = Average[q11](typicalPrice)
    c15 = (indicator5 > indicator6)
    c16 = (indicator5 < indicator6)
    
    TIMEFRAME(15 minutes,updateonclose)
    indicator2 = Average[q12](typicalPrice)
    indicator3 = Average[q13](typicalPrice)
    c7 = (indicator2 > indicator3)
    c8 = (indicator2 < indicator3)
    
    Periodc= q14
    innerc = 2*weightedaverage[round( Periodc/2)](typicalprice)-weightedaverage[Periodc](typicalprice)
    HULLc = weightedaverage[round(sqrt(Periodc))](innerc)
    c9 = HULLc > HULLc[1]
    c10 = HULLc < HULLc[1]
    
    TIMEFRAME(10 minutes)
    indicator1a = SuperTrend[q15,q16]
    c19 = (close > indicator1a)
    c20 = (close < indicator1a)
    
    TIMEFRAME(5 minutes)
    //Stochastic RSI | indicator
    lengthRSIa = q17 //RSI period
    lengthStocha = q18 //Stochastic period
    smoothKa = q19 //Smooth signal of stochastic RSI
    smoothDa = q20 //Smooth signal of smoothed stochastic RSI
    myRSIa = RSI[lengthRSIa](close)
    MinRSIa = lowest[lengthStocha](myrsia)
    MaxRSIa = highest[lengthStocha](myrsia)
    StochRSIa = (myRSIa-MinRSIa) / (MaxRSIa-MinRSIa)
    Ka = average[smoothKa](stochrsia)*100
    Da = average[smoothDa](Ka)
    c23 = Ka>Da
    c24 = Ka<Da
    
    ma3 = average[q21,q22](close)
    c21 = ma3 > ma3[1]
    c22 = ma3 < ma3[1]
    
    Periodb= q23
    innerb = 2*weightedaverage[round( Periodb/2)](typicalprice)-weightedaverage[Periodb](typicalprice)
    HULLb = weightedaverage[round(sqrt(Periodb))](innerb)
    c5 = HULLb > HULLb[1]and HULLb[1]<HULLb[2]
    c6 = HULLb < HULLb[1]and HULLb[1]>HULLb[2]
    
    //Long target and stoploss
    
    LSL = Q24 /10
    LTP = Q25 /10
    
    // Conditions to enter long positions
    IF Ctime and dhigh(0)-high<250 and c1 AND C3 AND C5 and c7 and c9 and c11 and c13 and c15 and c19 and c21 and c23 THEN
    BUY positionsize CONTRACT AT MARKET
    SET STOP %LOSS LSL
    SET TARGET %PROFIT LTP
    ENDIF
    
    //Short target and stoploss
    
    SSL = Q26/10
    STP = Q27/10
    
    // Conditions to enter short positions
    IF Ctime and low-dlow(0)<700 and c2 AND C4 AND C6 and c8 and c10 and c12 and c14 and c16 and c20 and c22 and c24 THEN
    SELLSHORT positionsize CONTRACT AT MARKET
    SET STOP %LOSS SSL
    SET TARGET %PROFIT STP
    ENDIF
    
    //================== exit in profit
    if longonmarket and C6 and c8 and close>positionprice then
    sell at market
    endif
    
    If shortonmarket and C5 and c7 and close<positionprice then
    exitshort at market
    endif
    
    //==============exit at loss
    if longonmarket AND c2 and c6 and close<positionprice then
    sell at market
    endif
    If shortonmarket and c1 and c5 and close>positionprice then
    exitshort at market
    endif
    
    //%trailing stop function
    trailingPercent = .26
    stepPercent = .014
    if onmarket then
    trailingstart = tradeprice(1)*(trailingpercent/100) //trailing will start @trailingstart points profit
    trailingstep = tradeprice(1)*(stepPercent/100) //% step to move the stoploss
    endif
    
     
    //reset the stoploss value
    IF NOT ONMARKET THEN
    newSL=0
    ENDIF
     
    //manage long positions
    IF LONGONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND close-tradeprice(1)>=trailingstart THEN
    newSL = tradeprice(1)+trailingstep
    ENDIF
    //next moves
    IF newSL>0 AND close-newSL>trailingstep THEN
    newSL = newSL+trailingstep
    ENDIF
    ENDIF
     
    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND tradeprice(1)-close>=trailingstart THEN
    newSL = tradeprice(1)-trailingstep
    ENDIF
    //next moves
    IF newSL>0 AND newSL-close>trailingstep THEN
    newSL = newSL-trailingstep
    ENDIF
    ENDIF
     
    //stop order to exit the positions
    IF newSL>0 THEN
    SELL AT newSL STOP
    EXITSHORT AT newSL STOP
    ENDIF
    
    //************************************************************************
    IF longonmarket and barindex-tradeindex>1800 and close<positionprice then
    sell at market
    endif
    IF shortonmarket and barindex-tradeindex>610 and close>positionprice then
    exitshort at market
    endif
    //=============================================
    if longonmarket and abs(open-close)<1 and high[1]>high and close>positionprice and high-close>10then
    sell at market
    endif
    if shortonmarket and abs(open-close)<1 and low[1]>low and close-low>13 and close<positionprice then
    exitshort at market
    endif
    //===================================
    myrsiM5=rsi[14](close)
    //
    if myrsiM5<30 and barindex-tradeindex>1 and longonmarket and close>positionprice then
    sell at market
    endif
    if myrsiM5>70 and barindex-tradeindex>1 and shortonmarket and close<positionprice then
    exitshort at market
    endif
    
    // ---------   US DAY LIGHT SAVINGS MONTHS      ---------------- //
    mar = month = 3 // MONTH START
    nov = month = 11 // MONTH END
    IF (month > 3 AND month < 11) OR (mar AND day>14) OR (mar AND day-dayofweek>7) OR (nov AND day<=dayofweek AND day<7) THEN
    USDLS=010000
    ELSE
    USDLS=0
    ENDIF
    
    once openStrongLong = 0
    once openStrongShort = 0
    if (time <= 223000 - USDLS and time >= 050000 - USDLS) then
    openStrongLong = 0
    openStrongShort = 0
    endif
    
    //detect strong direction for market open
    once rangeOK = 40
    once tradeMin = 1500
    IF (time >= 223500 - USDLS) AND (time <= 223500 + tradeMin - USDLS) AND ABS(close - open) > rangeOK THEN
    IF close > open and close > open[1] THEN
    openStrongLong = 1
    openStrongShort = 0
    ENDIF
    IF close < open and close < open[1] THEN
    openStrongLong = 0
    openStrongShort = 1
    ENDIF
    ENDIF
    
    
    once bollperiod = 20
    once bollMAType = 1
    once s = 2
    
    bollMA = average[bollperiod, bollMAType](close)
    STDDEV = STD[bollperiod]
    bollUP = bollMA + s * STDDEV
    bollDOWN = bollMA - s * STDDEV
    IF bollUP = bollDOWN THEN
    bollPercent = 50
    ELSE
    bollPercent = 100 * (close - bollDOWN) / (bollUP - bollDOWN)
    ENDIF
    
    once trendPeriod = 70
    once trendPeriodResume = 30
    once trendGap = 3
    once trendResumeGap = 6
    if not onmarket then
    fullySupported = 0
    fullyResisteded = 0
    endif
    //Market supported in the wrong direction
    IF shortonmarket AND fullySupported = 0 AND summation[trendPeriod](bollPercent > 50) >= trendPeriod - trendGap THEN
    fullySupported = 1
    ENDIF
    
    //Market pull back but continue to be supported
    IF shortonmarket AND fullySupported = 1 AND bollPercent[trendPeriodResume + 1] < 0 AND summation[trendPeriodResume](bollPercent > 50) >= trendPeriodResume - trendResumeGap THEN
    exitshort at market
    ENDIF
    
    //Market resisted in wrong direction
    IF longonmarket AND fullyResisteded = 0 AND summation[trendPeriod](bollPercent < 50) >= trendPeriod - trendGap THEN
    fullyResisteded = 1
    ENDIF
    
    //Market pull back but continue to be resisted
    IF longonmarket AND fullyResisteded = 1 AND bollPercent[trendPeriodResume + 1] > 100 AND summation[trendPeriodResume](bollPercent < 50) >= trendPeriodResume - trendResumeGap THEN
    sell at market
    ENDIF
    //
    //Started real wrong direction
    once strongTrend = 60
    once strongPeriod = 8
    once strongTrendGap = 2
    IF shortonmarket and openStrongLong and barindex - tradeindex < 12 and summation[strongPeriod](bollPercent > strongTrend) = strongPeriod - strongTrendGap then
    exitshort at market
    ENDIF
    
    IF longonmarket and openStrongShort and barindex - tradeindex < 12 and summation[strongPeriod](bollPercent < 100 - strongTrend) = strongPeriod - strongTrendGap then
    sell at market
    ENDIF
    
    #146098 quote
    Dow Jones
    Participant
    Veteran

    anyone else have a system running that isn’t stopped on a regular basis

    I have run both MoD DAX and DJI for many months, no such issue for me.

    For your issue, in my experience, to debug the issue, better to take note when the issue reported, so you can build indicator or GRAPH the suspected division method to check. The problem is Probacktest doesn’t report issue with zero division, I did a dummy test before to purposely divide by zero and backtest still can complete successfully.

    #146100 quote
    christofferR
    Participant
    Average

    I have run both MoD DAX and DJI for many months, no such issue for me.

     

    Yes it works great for with all indexes but can’t get it to run on Brent Crude oil. Tried several setups and always get the zero division error message or the suggestion of preloading bars (can’t remember the error message on top of my head)

    #146102 quote
    swedshare
    Participant
    Senior

    I worked with a strategy on Brent but realized I had to scrap it because of constant zero division error. You can forget about oil for automated trading.

    Dow Jones thanked this post
    #146105 quote
    scoot3r83
    Participant
    Average

    Out of curiosity… what are the values you use for you 5M RSI calculations?

    #146110 quote
    christofferR
    Participant
    Average

    Out of curiosity… what are the values you use for you 5M RSI calculations?

    This test (have done a few) 8, 3, 12, 11

    I worked with a strategy on Brent but realized I had to scrap it because of constant zero division error. You can forget about oil for automated trading.

    Thanks for confirming that i’m not mad

Viewing 15 posts - 346 through 360 (of 523 total)
  • You must be logged in to reply to this topic.

Mother of Dragons trading strategy…


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 522 replies,
has 50 voices, and was last updated by LaurentBZH35
4 years, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/21/2020
Status: Active
Attachments: 195 files
Logo Logo
Loading...