System won't take extra new positions?

Forums ProRealTime English forum ProOrder support System won't take extra new positions?

  • This topic has 14 replies, 3 voices, and was last updated 6 years ago by avatarBard.
Viewing 15 posts - 1 through 15 (of 15 total)
  • #42813

    Hi

    Can anyone figure out why the code to increase the number of positions up to a max of 3 positions (based on 30 tic increases per position) does not work?
    £/$ 1 Hour — 3.8 tic spread. Date: 01/01/17 to 01/06/17.

    I’ve simplified the system to the point where there are no other criteria for extra positions (#2 and #3) other than an increase of 30 tics from the last position taken. When the market moves eg over 50 tics no other extra position (#2) is taken?

    Even changing/reducing the tic move required in the code from to Close-TRADEPRICE(1)>30 to Close-TRADEPRICE(1)>10 and also changing Close-TRADEPRICE(1)>60 to Close-TRADEPRICE(1)>20 still does not result in any extra positions being taken after a 10 or 20 tic increase/decrease in price? Please see screenshot with altered (from 30 tics moves) 10 tic and 20 tic moves not being taken.

    Thanks for any help,
    Cheers
    Bard

     

    #42831

    Hi,

    I’m just in forum quick reading mode, haven’t tried the code, but at first glance, your picture shows GBPUSD, and your code shows IF TRADEPRICE(1)Close>30 but it doesn’t feel like the forex pair can jump a full 30 between your close and tradeprice(1), in other words let’s say your tradeprice(1) was 1.3 on gbpusd it won’t jump to 31.3

    So I guess either you wanted 30 ticks (tick size is 0.00001 for this one) and could try to replace your 30 by 30*ticksize, or maybe you rather wanted 30 pips (pipsize is 0.0001 which is different from the ticksize) and could try to replace your 30 by 30*pipsize

    #42836

    Problem already spotted and discussed in the other thread about pyramiding, don’t know why Bard is still making this error 😳

    #43027

    Thanks Noobywan and Nicolas,

    So the code above is still incorrect? D’oh! I added “cumulative orders,” although without adding a “count of positions” code it just takes a trade regardless of no actual crossing of the 0.8 / -0.8 Oscillator threshold.

    So then the “count of positions” and “if on market” code was then added but the system took long trades at lower prices than the original opening positions defying the >30 ticks requirement for the 2nd and 3rd positions. It then took 4 positions instead of the maximum of 3. Changing to 30*pipsize or 30*ticksize didn’t fix it.

    If the “if on market” code is not added to the original 1st position which needs to cross the 0.8 or -0.8 oscillator thresholds for entry (but is added on the 2nd and 3rd positions (no oscillator threshold required just >30 ticks)) then it will take cumulative positions albeit again incorrectly buying at lower prices for long trades…. (From experience I would never average down when trading).

    Reversing the order of the “Close-Tradeprice” for the short side actually produced the same number of trades and profit? Although initially it was clearly incorrectly written back to front for the short side. The system still defied the >30 for 2nd and 3rd positions and bought long positions at lower prices…(Adding a graph for “count of positions” and removing “buy 10 contracts” replacing it with “buy 10 perpoint,” just mirrored the actual trade positions chart segment, e.g. +10 or +20 for £10/tic or £20/tic trades)?

    Currently it is just taking one long position then closing it out and going short and then long again etc, (with “if on market” code for each of the 3 positions and oscillator crosses only for the position #1 and >30 tick “increases” for positions #2 and #3).

    And that is, with all the gratefully received feedback, where I’m at with my Amos Hostetter pyramiding coding attempt! What I’m currently obviously missing to make it buy a maximum of 3 positions with 30 tick differences between each position genuinely escapes me as I have tried many different code permutations. I have spent a lot of hours on something that I thought would just take 30 minutes to achieve…

    (As an aside, I’ve yet to find any system (even those on lease) that can come anywhere near my intraday % returns when I was a disciplined (and time rich) discretionary trader. However, the market turmoil and volatility post Credit Crunch was “tricky” as I then became heavily biased to the short side and it negatively impacted my trading style (eg taking a £9k spot £/$ short loss in 24 hours, closing out the £9k loss, as per my money management rules, and then watching it go back to breakeven a few hours later.. Lol) which is why I got interested in automated trading).

    Thanks again,
    Best
    Bard
    #44111

    Hi @Nicolas, “What I’m currently obviously missing to make it buy a maximum of 3 positions with 30 tick differences between each position genuinely escapes me as I have tried many different code permutations.”

    Maybe it’s a case of I “can’t see the wood for the trees” but if you could tell me where I’m going wrong that would be appreciated as I’ve read and re-read you comments on the other page?

    P.s. @Noobywan, right, pips = 4 decimal places and ticks 5. thanks.

    Cheers
    Bard

    #44112

    I edited your code, you’ll find below the strategy part that deal with putting orders on market by comparing your 30 or 60 pips (didn’t tested):

     

    #44128

    Thanks Nicolas,
    Btw, where did you mention using pipsize on the other page?:
    https://www.prorealcode.com/topic/increase-number-of-position-based-on-30-tic-moves/

    There’s no pyramiding if you leave the command “Not longonmarket” in the first position (of three total positions) code which is why I didn’t think it worked using *pipsize.

    “Not longonmarket” has to be removed to allow pyramiding of positions?

    Looking at the pyramiding rule of buying (or selling) if there has been a 30 pip increase (or decrease) it still takes e.g. Short positions when the difference of 30 pips has not been met?

    In the first two screenshots I’m wondering why it’s shorting more positions when the second screenshot is showing a higher price than the previous trade, it should only be opening new positions if the market is moving in it’s favour? Ditto for screenshots 3 and 4. (all part of one short trade that has taken far too many positions, -£110 at £10/pip). Ditto for long trades in screens 5 & 6.

    £/$ Spot 1 Hour — Jan 3rd 2016 – 1st June 2017.
    Univ Osc = -0.9 and 0.9 cut off. Univ Oscillator Bandedge = 100 (a slightly imbalanced number but it has produced good results in the past on Daily charts too)

    35 trades. 401% Return, Drawdown = 22.9%. Although the attached equity graph shows about a 70% drawdown??
    If it’s extended forward by 6 months at a time it’ll make a profit each time/test.

    Richard Dennis used a Drawdown cut off at 50%. Kevin Davey uses 40%. This because they had/have multiple system running.

    #44134

    p.s. screens 5,6 & 7 not attaching – retrying again here.

    #44142

    Please repost the entire code and I’ll try debugging it entirely if I find time between 2 other activities 🙂 I’m still not back from leave, so please be patient.

    #83552

    Hello @Nicolas, I’ve revisited this system code after @Vonasi pointed out why a similar code wasn’t adding new positions at  £10/tick. 
    (#82651)

    The  COUNTOFPOSITION=1 code, should be  COUNTOFPOSITION=10.  

    The idea was to buy or sell up to a max of 3 positions at a time (at  £10/tick,=  £30/tick max exposure) based on moves in the market in my favour of greater than 30 ticks for each individual new trade. I’m still not sure it’s following that rule as I see some trades with far more than 30 ticks difference when the second position is taken? (That’s even when you account for the fact that the system can’t enter until the next bar which might open a lot higher if you’re long or lower if you’re short).

    It seems the only way I can stop the excessive pyramiding of positions (because CumulateOrders = TRUE) is to add this not very friendly or concise  COUNTOFPOSITION = 40 code see below, but even then the short side takes too many trades?

    Cheers
    Bard

    The whole strategy is here below: 

$/CHF, 4 HOURS, 3.8 spread — 04/01/17 – 25/10/18
    (Ehlers Universal Osc Bandedge is optimised at 124, but it really doesn’t need an optimised value as any value over 75 is stable and I normally find 100 to be reliable (= £73k profit). Pls see “stable bandedge” screenshot). I’m looking forward when we can optimise by drawdown too, but was reminded of a workaround today when I saw an old post of mine  (“How to optimise a look back period”) where you’d mentioned using MAE and making a percentage distribution in Excel.

    Ps/ Having a lot of trouble using Safari v12 and this blog. The Insert Code is not working and when I post it adds html coding within my text?

     

    The  COUNTOFPOSITION works for the long side (no more than  £40/tick at any one time, if it hit’s 40 it closes it on the next bar,  but reaches 210 ( £210/tick) on the short side,    (please see “too many short positions” graph image).

    Cheers, 
    Bard

     

     

    #83555

    Okay so it worked on the second edit and submit, not sure why every first attempt at posting and then submitting it doesn’t insert PRT code properly as this is the second time today this has happened? Also I am not sure why “The  COUNTOFPOSITION works for ” paragraph is at the very bottom of my post, it was above the PRT code. Might be better to use Firefox…

    #83727

    COUNTOFPOSITION is negative for short orders.

    #83890

    Thanks @Nicolas, I added the negative symbols for: COUNTOFPOSITION = -10 and COUNTOFPOSITION = -20, but it’s still the

    code that stops the system from otherwise taking too many short entries? The two screenshots show what happens if the -40 code is REM’d out or not REM’d out. Wondering what else needs to be modified on the short code to get it to just take a maximum of £30/tick (3 positions)?

    Also shouldn’t the Walk Forward be doing more repetitions if it was still in profit at the end of the first OOS date? (pls see 3rd screenshot). Cheers,

    #84500

    Hi Nicolas, I could do with a little help here to figure out what is stopping this long and short code from working and only taking a maximum of 3x £10/tick? I have to use “If COUNTOFPOSITION = -40 THEN EXITSHORT AT MARKET” to stop it overtrading.

    Pls see screenshot “Way too many shorts.png” (and longs )

    Cheers
    Bard

     

     

    #84512

    Ignore the last comment @Nicolas!
    I’ve spotted the problem: The code needed If NOT ShortOnMarket for the original trade and subsequent trades:

     

Viewing 15 posts - 1 through 15 (of 15 total)

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