Help to program an idea that worked

Forums ProRealTime English forum ProOrder support Help to program an idea that worked

  • This topic has 42 replies, 4 voices, and was last updated 8 years ago by avatarquo.
Viewing 13 posts - 31 through 43 (of 43 total)
  • #15688

    All right, at long last I think I got it. You can have a “relaxing cup of café con leche” on me, you well deserve it. Why all this blunder of us but mainly mine? Well, as Her Gracious Majesty would put it: Shit happens!, but She’d really be thinking: Diana happens!

    After the joke of the day, let’s talk business:

    First, could you, when you have the time to spare, take a good look at picture Example-1 and confirm to me that’s how the strategy works? (Always with exit filter being equal to 0%).

    Then, in picture Example-2, what value shoud have stop2? 148,6, the low of bar 1, or 144,16, the low of bar 2? That is, are the stops the lowest low between maximums (these excluded) or the lowest low with the more recent maximum (bar 2 too in this case) included?

    If picture Example-1 is OK, that would be my only doubt right now. Others could appear in coding time, but I don’t think so. As a penance, I intend to try and code most or all of the strategy during this weekend.

    Thanks. More soon.

    #15697
    quo

    Hi again, i think we are almost there.

    You got it, but let me be fussy:

    -.The day when we change the stops is the day marked with vertical blue dot line (i think we agree on that)

    -.I see in jun 1993 that market crosses over the maximum (just by milimiters) before fall down, so to be strick you would have to rise the stop to the minimum of april (0,41 aprox). Therefore a stop number 4 is missing in that place and the exit should be there.

    Lets go with picture number 2. Here is when you get to the point.

    The answer to this question is: it depends

    Talking about candle march 2014: If market opens and prices goes up to the maximum the stop will be number 1 because we dont have yet the minimum of march, but if prices goes down after the opening and after touch its minimum goes up and crosses the máximum, the stop will be number two. It is always the lowest point the day of the break out.

    I normally check this manually going to weekly charts but i know this is not possible to code, so we have to establish by default something. PRT doesn´t know what happends first, the minimum or the maximum.

    If i had to choose, in order to set the rules… i would say… that the system has to take stop number 2.I think is easier to code find the lowest between two day including first and last bar. Don´t you think?

    The results won´t be the same than doing manually but i promise that if this is the only difference will be a great work and really helpful.

    cheers

     

    #15699

    Hi,

    Quote: “I see in jun 1993 that market crosses over the maximum (just by milimiters) before fall down, so to be strick you would have to rise the stop to the minimum of april (0,41 aprox). Therefore a stop number 4 is missing in that place and the exit should be there.” 

    ??? If so, we are back to square one, man.

    I didn’t want to, but I’m going to open a new thread in the Spanish forum. After all, it’s free, isn’t it?. See you there shortly.

    #15703
    quo

    But where is the problem?

    You did it with 3 previous stops and the fourth one is the same reasoning. New maximum, you rise the stop.

    i thought we almost got it. 🙁

    cheers

    #15708

    The problem is we sell at 0.3 and not at 0.41.

    The high of jun 1993 brokes the high of jan 1993 as you say and THEN I move the stop to 0.3 from 0.23. The stop will not be moved to 0.41 until the high of jun 1993 is broken which has not happened. That is my understanding but that’s not what you are saying, is it?

    #15710
    quo

    Ok, lets go:

    1. Dec 1990, new maximum, then stop in 0,11
    2. January 1992 new maximum , then stop up to 0,23
    3. Dec 1992, new maximum, then stop up to 0,3
    4. Jun 1993, new maximum, then stop to 0,41

    Every new maximum (vertical blue dot line) you look backwards to find the lowest value between the day of the break (vertical blue dot line) and the previous maximum (where the horizontal blue dot line begins).

    #15712

    Morning man, late night I see.

    Ok, that’s what has to be done. Understood. In fact, it’s the logic and natural thing to do.

    But you wrote: “You did it with 3 previous stops…”. No, I didn’t. Look again CAREFULLY to my picture.

    Never mind, as I say: NOW I got it. So, good news and hallelujah!

    No need then to answer to my post in the Spanish forum. Let’s keep it in standby though. We might need it in future.

    Bye

     

    #15732

    “Oh Lord, please don’t let me be misunderstood” sang The Animals and Nina Simone before them. Oh Lord, how well we understand you, guys!

    The version v.03.1 of the strategy code goes like this:

     

    #15797
    quo

    Thanks,

    Checking it. I will be back soon. It looks good. I have seen a mistake but nothing important. What you did already is enough and i am grateful but i wonder if we can go one step beyond. Maybe privately if possible.

    thanks again.

    Nacho.

    #15818
    quo

    Hi Tikitaka, great job, thank you very much. I got already more than i thought. However have seen things to tweak if you feel like:

    a) Sometimes there is a low<low[1] but the stop is not risen. It is because in the same candle we got a high>high[1]. Examples Citigroup (feb1993), Sabadell (may2016), ENGI(jan2008), ESRX (may2015).

    b) Sometimes systems stops, i don´t know why, maybe is database, my computer, tell me if happens to you. Examples: British American Tobacco (from 2010 doesn´t give signals and we have new maximums), Next (NTX)(from 2011), Royal Dutch Shell(from 2012), Sabmiller (SAB from 2012).

    c) System buys when prices is >= historical maximun and it should be >. In fact i normally put a filter of some cents. Example: Standard Chartered(STAN) (nov 2010).

    I don´t know if i am going too far but taking advantage of your kindness i would ask you if you can:

    1.-Code it for short positions. Same logic but for going short.

    2.-What do i have to add and where, if i want to raise the stop to the entryprice+1% when prices reach 10% of profit. Something like:

    3.-Change 2000 cash into shares following this formula: Number of shares will be (Equity line*0,6%)/(Entryprice-Stopprice) and if the result multipied by the price of the stock is less than 1000 don´t buy. Equityline is 50.000 when we start and later what i have in the equity line or equity curve (the result of add to 50.000 previous trades).

    I imagine you running away after this post and i understand. The thing is that i don´t know if what i am asking you is difficult or not. If it is going to take you long forget it please, you have already did enough.

    In fact you can forget a), b) and c) if it takes you time and pay attention to what is more important to me: 1) then 2) and finally 3). (I believe point 3 is the most difficult one and is the less important to me).

    already gratefull, cheers

    #15819
    quo

    soory point 2 did not take me PRT code

    #16019

    Hello, hello, hello. Many things.

    Some anwers (the easiest ones):

    b) That’s because its prices are > 2000, our capital in the code. No worries.

    c) Yes, I was aware of the fact. We could use, if you agree:

    In ProBacktest seems to work OK. I’m not utterly sure with real brokers, though.

    .1) That will have to wait until the code for the long positions is good and clean.

    2) A possible code (instead of lines 58 to 61):

    Waiting for your comments. For the rest, I’ll have to think about and possibly discuss int the Spanish forum.

    Ciao

    #16042
    quo

    Hi again, many thanks

    Comments in Spanish forum then

Viewing 13 posts - 31 through 43 (of 43 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login