Entry on fib retracement?

Forums ProRealTime English forum ProOrder support Entry on fib retracement?

Viewing 15 posts - 1 through 15 (of 26 total)
  • #18115

    Hi, I was wondering if someone could help me with writing how to enter a position on a fib extension.

    I am trying to code for price breaking out of a range, and then reaching a high. I have gotten that far, but once price has reached that high, I want to set an order to enter the market at the 62.8% fib retracement of that high.

    I was wondering if anyone else has coded fib retracements before?

    #18134

    There is a nice example of Fibonacci extension calculation from a recent high here in this stock screener: Fibonacci 61.8% retracement screener

    #18135

    Hi Nicolas, thanks for the reply!

    I was looking at that when I was writing my code, So far I have this:

     

    Where MakeTrade refers to the time of day, ll is the lowest low of the period I want to measure from and hh is the breakout.

    What I’m struggling is setting the order for entry, I thought that by defining Entry as the fib + ll and placing an order there would work but my code completely ignores it?

    #18138

    Maybe because if your Close is superior to the current hh, your Close IS THE NEW hh. So you should refer to a previous hh to test if your Close has actually breach this level.

    #18144

    Hmm I don’t think that is the case, I want to set a between 5pm and 7am the next day, so when I code that I do it by saying

    When n is the number of bars going back to 5 pm the previous day. Then once that is recorded for that day, I want to check for a breakout between two times later the next day. if price breaks out between these times, wait for a turning point (as in a highest high) and then use that to work out the fib retracement from the previous low.

    I know it sounds really complicated to type, but any help would be really appreciated!

    I know its quite complicated to type, but any help would be really appreciated!

    #18145

    Please post the whole code, as I could read it in complete and better understand where is the problem. Thanks.

    #18151

    Ok sure, here it is:

     

    Its still a very rough version but its what I have so far, n = number of bars from 5pm to 7am, and y = number of bars from 7 to 10am

    It would find the significant turning point (or the closest thing to that) between 7 and 10 and calculate the fib from there. Ultimately I want to code it to work both ways, but for now while I’m still getting to grip with coding I’m just doing the break to the upside.

    I was also wondering, since it should only technically make one trade a day if conditions are met, do I have to tell it to restart every day? or will it automatically start doing that at 5pm anyway?

    Thanks 🙂

    #18194

    Hi Nicolas, do you have any ideas about how I can tackle this? Or is it a lost cause haha

    #21926

    Hi KJ

    Did you get any further with this one please? Maybe it slipped through a crack in Nicolas busy schedule? He might catch sight of it again now.

    I manual trade using Fib levels and so I’ve run your code on Demo since 11 Dec and results look very promising – see attached. I made a few very minor changes … I’ll put them on here tomorrow.

    Thanks
    GraHal

    #21953

    Here’s my few changes, main change is Buy (Sell in original code??) in Line 25.

    Results attached for DAX 5M @ £1 per point.

    (Why cant I see ‘Insert PRT Code’ again Mods?)

     

     

    #21964

    Hi Grahal,

    Maybe Nicolas was installing some upgrades on the website resulting on the “insert PRT code” function temporarily not available, no worry I’ll edit your post with PRT code style

    #21970

    The text editor of forums have 2 tabs, you’ll find them on its upper right side, choose “Visual” one to get the rich text capabilities and the “insert PRT code” button.

    About this topic, I’m sorry, because I’m involved in many ones, this one came out of my head.. Thanks GraHal about the help you give to kg6450. Let him answer to your code fix and see if you were correct about the BUY order instead of the SELLSHORT one.

    Results seems decent, did you test any further in the past data?

    #21977

    I tried both tabs, even Visual Tab did not have insert PRT Code available; also same for me a day or two back. No big deal for me, but I didn’t want you / mods thinking I’m causing you work 🙂

    I’ve got  qty 4 PRT Platforms open (I’m rationalising my 200 Demo Algos! :)) if I can’t see PRT code button again, I’ll close platforms one by one to see if it makes any difference. Maybe this is why I’ve had a few other odd ‘platform scenarios’ this week!?

    The results above are over 100,000 units @ 5M as this is the most history I get with IG.

    Cheers
    Graham

    #21978

    If only we could ‘edit out our crap’ 🙂 … I’m mixing up PRT Platform snags and PRC Website snags now … apologies, disregard the 2nd paragraph above please!! I must slow down my brain & fingers, I must slow down my ………. ! haha

    GraHal

    #21983

    I’m glad to have you on board  GraHal,  always diverting on a Saturday evening 🙂

    1 user thanked author for this post.
Viewing 15 posts - 1 through 15 (of 26 total)

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