Maximize profit DAX 1 minute

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #114754 quote
    ladis
    Participant
    Junior

    Hello to you all,

    I hope that someone here can help me with  the following problem, because I don’t know how to code it.

    I trade dax futures in the 1 min frame.

    When my indicator gives the right signal, I buy 1 future long.

    If the index drops more than 30 point below my entry point I buy another one. If it drops more than 60 point below the first entry point I buy another one

    My TARGET pPROFIT is pointofpositionprice +14 pips.

    It allways reaches this target, but sometimes I first have a drawdown of 100 pips before it does so and sometimes it crushes through the 14 pips and keeps on climbing.

    So I would like to implement a trailingstop SET STOP pTRAILING 14

    I tried different methods, but it doesn’t work.

    Below is what I have now.

    In attachment I try to explain what I mean. I appologise if I didn’t make myself clear.

    Many thanks in advance!

    All the best with your coding and trading!!!

    DEFPARAM CumulateOrders = true 
    
    indicator1 = CALL "long DAX 1 Beste"[28,7,35,19](close)
    c2 = (indicator1 >= 2)
    
    
    if time>081000 and time<212500 AND ONMARKET = 0 then
    IF c2 THEN
    BUY 2 SHARES AT MARKET
    ENDIF
    endif
    if longonmarket and countofposition = 2 and positionprice - close > 30 then
    buy 1 shares at market
    endif
    
    if longonmarket and countofposition = 3 and positionprice - close >  50 then
    buy 1 shares at market
    endif
    
    if longonmarket and countofposition = 4 and positionprice - close >  100 then
    buy 1 shares at market
    endif
    
    SET TARGET pPROFIT +14
    
    PRT-Forum2.jpg PRT-Forum2.jpg PRT-Forum1.jpg PRT-Forum1.jpg
    #114783 quote
    GraHal
    Participant
    Master

    Did you try looking in the Snippet Link Library … link to a Topic containing 4 Trailing SL below (it’s Log 11 in the Snippet Library)

    Snippet Link Library

    https://www.prorealcode.com/topic/trailing-stop-and-breakeven-codes/#post-93285

    Let us know how you get on please?

    EDIT / PS

    There are several more rows containing Trailing Stops in that Link Library … use the ‘Find’ function on Trailing.

    ladis thanked this post
    #114785 quote
    GraHal
    Participant
    Master

    I’ve just ‘named as Type’ … 10 x Trailing Stop snippets … filter on column B on the Link below

    Snippet Link Library

    ladis thanked this post
    #114787 quote
    ladis
    Participant
    Junior

    Fantastic! I didn’t know about this snippet list.

    I am going to search through the list and try them out tomorrow and I will keep you posted.

    Many thanks and good night!

    GraHal thanked this post
    #114842 quote
    ladis
    Participant
    Junior

    Dear GraHal,

    I tried the different trailing setups from the snippet link library, but they never give an outcome as good as just setting the pPROFIT +14.(attachment 18/12/2018 (when PRT started to load dayround FDAX) till today)

    The problem is that quite some times the index goes a bit in the good direction and then falls back so the (trailing) stoploss is hit. If I set the trailingstart too high( >20), the results drop (trail 1) so I don’t know how to adjust this.

    When I trade manually and when the index > 14 point above start, I set a trailing stop manually at the broker. If I set a goal > 14 I go overnight and my position could be forcefully closed by IB. 🙁

    When I fully autotrade I miss the extra “index-up” when there is one and that could be a major extra bonus.

    Any idea’s?

    Many thanks and have a wonderful weekend!

    #114843 quote
    ladis
    Participant
    Junior

    Attachment was not included… Sorry

    PRT-forum3.jpg PRT-forum3.jpg
    #114969 quote
    Nicolas
    Keymaster
    Master

    Since you don’t know how the market will behave, how do you want to know in advance the best trailing stop setting in points? Trailing stop is sometimes not a good choice, because it cuts dramatically the profit in the overall results.

    In your averaging down scenario, I would say that if you want to include a trailing stop, the MFE type one would be the first idea to start with. But there will always a setting in points that sometimes would act as the best choice and sometimes not ..!

    ladis thanked this post
    #114971 quote
    ladis
    Participant
    Junior

    Thank you Nicolas for your reply. Indeed you are right.(as if somebody would have doubted that 🙂 )

    I tested the different kind of trailingstops in the snippet library, but there is no good outcome for such short trades.

    I stick to the TARGET pPROFIT and a STOP pLOSS. Works best.

    After 6 months of testing and auto-paper-trading, I hope to go live in January.

    I will keep you posted…

    #116126 quote
    ladis
    Participant
    Junior

    If I want to do the same for short, then I am not able to sellshort another share.

    Does anybody know what I do wrong?

    It doesn’t add more short and it doesn’t exitshort when time > 215500

    DEFPARAM CumulateOrders = false 
    
    indicator1 = CALL "Short Dax 1 min 07012020"[73, 15, 30, 84](close)
    c1 = (indicator1 =< -3)
    if time>085900 and time<212500 and NOT SHORTONMARKET THEN
    IF c1 THEN
    SELLSHORT 2 SHARES AT MARKET
    ENDIF
    endif
    if shortonmarket and countofposition = 2 and close-positionprice > 30 then
    sellshort 1 shares at market
    endif
    
    SET target pPROFIT +12
    
    if time > 215500 and countofposition > 1 then
    exitshort 1 share at market
    endif
    
    #116131 quote
    Nicolas
    Keymaster
    Master

    It doesn’t add more short orders because you have set CumulateOrders to false! 😉

    COUNTOFPOSITION is negative for short orders, you should code it like this:

    if time > 215500 and countofposition < -1 then
    ladis thanked this post
    #116136 quote
    ladis
    Participant
    Junior

    Ok. That was not so smart of me… Many thanks Nicolas.

    Now I tried:

    
    DEFPARAM CumulateOrders = true 
    
    indicator1 = CALL "Short Dax 1 min 07012020"[73, 15, 30, 84](close)
    c1 = (indicator1 =< -3)
    if time>085900 and time<212500 and NOT SHORTONMARKET THEN
    IF c1 THEN
    SELLSHORT 2 SHARES AT MARKET
    ENDIF
    endif
    if shortonmarket and countofposition = -2 and positionprice - close > 30 then
    sellshort 1 shares at market
    endif
    
    SET target pPROFIT +12
    
    if time > 215500 and countofposition < -1 then
    exitshort 1 share at market
    endif

    but it still won’t go short 1 more share when the future goes up more than 30 points from entry…

    What do I do wrong?

    #116137 quote
    ladis
    Participant
    Junior

    ooooh I see I must put “close – positionprice > 30 ” off course!!!

    Sorry and many thanks!

    #121164 quote
    ladis
    Participant
    Junior

    Dear All,

    I want to reset my system when the highest value of the last 85 candles/bars – the close[0] > 120 pips

    I do this like this:

    High[85] – close[0]>120 but that doesn’t seem to work

    or

    HIGHEST[85](High) – close[0]>120 but that doesn’t seem to work either???

    Can anyone help me?

    Many thanks!

    #121178 quote
    robertogozzi
    Moderator
    Master

    Your line is correct if you trade DAX or SP500, while it won’t work with FX pairs, add PIPSIZE:

    HIGHEST[85](High) – close[0]>120*pipsize

    I think this should do.

    ladis thanked this post
    #121181 quote
    ladis
    Participant
    Junior

    Dear Roberto,

    It was in DAX.

    I couldn’t understand why it didn’t work so I closed PRT and restarted my PC and now it works perfect.

    Many thanks and good trading!

    Ladis

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

Maximize profit DAX 1 minute


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
ladis @ladis Participant
Summary

This topic contains 16 replies,
has 5 voices, and was last updated by ladis
5 years, 10 months ago.

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