oil-10min-hammernegated-pattern-strategy

Viewing 15 posts - 46 through 60 (of 94 total)
  • Author
    Posts
  • #42409 quote
    Juan Salas
    Participant
    Master

    Hi Francesco,

    Right now, the trailing you have coded fixed the benefits above TGL (or TGS for short). Once the price is above TGL, the trailing stop is activated. Sometimes, I have realised that when is winning 32 pips (in case of TGL=32), it activate the trailing just above cero.

    Following this example, is there any way once the price goes 32 pips that it could be locked to 15 for example? I am studying this part of the code, but have no clue on how to get it. I was never the smartest kid of my class :)), so I wanted to ask you first, in case there was an easy solution (i.e.- just changing the value of some parameters).

    If any other case, I will continue studying your trailing code.

    Thanks anyway for the hammer negated. It works really well.

    Best,

    Juan

    #42410 quote
    Nicolas
    Keymaster
    Master

    That’s right, this trailing stop code is the ‘max favorable excursion’ one you can find in this blog article: https://www.prorealcode.com/blog/learning/trailing-stop-max-favorable-excursion-mfe/

    But the way you want the trailing stop to move is the one explained in this other blog post: https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/

    with this last one, you can set the “trailing start” which is the amount of point in profit to start the function and the “trailing step” which is the step in points of the stoploss.

    Francesco78, Juan Salas and Ipsch thanked this post
    #42413 quote
    Juan Salas
    Participant
    Master

    Hi Nicolas,

    Thanks so much. I will check those blogs. Nothing that is achievable is enough.

    Best,

    Juan

    #42415 quote
    Juan Salas
    Participant
    Master

    I meant: Knowing that is achievable….

    #42439 quote
    Despair
    Blocked
    Master

    @Juan: Don’t be too eager to lock in profit and trail the price too closely. What you will achieve most likely is that winning trades are closed prematurely with only a small profit. Been there, done that. 😉

    #42571 quote
    Juan Salas
    Participant
    Master

    @Despair: You are right. It close the winnings prematurely. What I am doing is setting the trailing start close/equal to my profit, and allowing the profit to run after securing benefits, but it is not as simple as I pictured it in my mind 😉

    #42990 quote
    Kenneth Kvistad
    Participant
    Senior

    Hi.

     

    I have ran Nicolas fix version of this strategy since some of us could not make the org. Version to start in.live prt.

    Now i stopped the strategy after 10trades or so to up my contracts but after doing so it wont start again. I Get error stopped after pushing start/run and code says

    Not enough historical data and preloadbars need to.be same or above 1000?

    #42999 quote
    miguel33
    Participant
    Senior

    Strange … yesterday in demo closed me in profit … in real loss. 🙁

    #43001 quote
    Kenneth Kvistad
    Participant
    Senior

    I got loss in real buy but I also got.loss in.backtest ,but I have tested many times in.bactest and somethimes this trades win as well. Sometimes it happens but I dont belive its a big problem becase sometimes you win.and bactest showes loss 🙂

    #44437 quote
    Despair
    Blocked
    Master

    Hi Francesco,

    I really like this strategy of yours but I had a problem with the wide stop loss. The result of having such a wide SL is that you get a buy/sell signal and then it is possible that the trade just goes sideways for a long time without hitting TP or SL. This didn’t feel right for me. If we get a negated hammer the result should be a direct move in the direction of the trade. Staying in the trade longer makes it a game of chance IMO. 2-3 hours (or more) after the negated hammer the signal has lost it’s power and the trade failed in my eyes. Staying in the trade longer then is only hoping for the trade to develop in the right direction. And I don’t like hoping. 😉

    Therefore i introduced a time stop. After 3 bars (30mins) I check if the trade is in profit, is this not the case i close the trade.

    if barindex-tradeindex=3 and positionperf<0 then
      if longonmarket then
        sell at market
      elsif shortonmarket then
        exitshort at market
      endif
    endif
    

    Adding this time stop to your strategy of course reduces the winning % but risk is contained much better and the average losing trades is reduced by 80%!

    I think this is an improvement that rectifies the time stop.

    AsgerK and Ipsch thanked this post
    #44449 quote
    Francesco78
    Participant
    Master

    thank you Despair! I agree very much with what you said. I am travelling now and I cant test your code right now. Would be great if you post a picture of the statistic of the strategy. thanks again.

    #44455 quote
    Despair
    Blocked
    Master

    Here is the result of my version (I have probably made more changes to your original version but forgot which hahaha) with time stop. My version without time stop had an average losing trade of about 60 USD. Now it is down to 10 USD.

    BTW: Some time ago you mentioned the possibility to team up in strategy development. I would be interested in a little tighter cooperation with a fellow physicist. 🙂

    Hammernagted-with-time-stop.png Hammernagted-with-time-stop.png
    #44673 quote
    Francesco78
    Participant
    Master

    hi Despair, many thanks, apologies for the late reply but im travelling in Greece right now. yes sure we can try to team up in strategy devopment.

    Edit by admin:please don’t share personally information on forums, thank you.

    Despair thanked this post
    #45650 quote
    rejo007
    Participant
    Senior

    hello,

    do you have an updated version (with the despair’s add)?

    thanks

    #48239 quote
    ozz87
    Participant
    Senior

    @rejo007, took a look at this one. Trying to find strategies that requires low capital so I can run more than just a few.

    Got the best results with Despairs change set to 2.

    Crude-hammerpattern-10-min.itf hammer.png hammer.png
Viewing 15 posts - 46 through 60 (of 94 total)
  • You must be logged in to reply to this topic.

oil-10min-hammernegated-pattern-strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 93 replies,
has 25 voices, and was last updated by nonetheless
6 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/11/2017
Status: Active
Attachments: 16 files
Logo Logo
Loading...