FIBO on each pinbar
Forums › ProRealTime English forum › ProOrder support › FIBO on each pinbar
- This topic has 45 replies, 5 voices, and was last updated 3 years ago by
lisamitch50.
-
-
11/20/2020 at 2:52 PM #151055
I’d love to get screenshots of the examples you mentioned. It’d be much easier for me to visualize the changes to do 🙂
Or if you don’t manage to attach screenshots, you could tell me what candle you’re talking about (with accuracy)
Tbh, I made up my own definition of a pinbar, which is that the wick should be at least 3 times the length of the body and the tail (the opposite one) should be small. But I’d rather have your definition since your strategy seems to be doing well
I’ll try and add the short version to the long one when I can. It’s easier for me to focus on one only for now haha
1 user thanked author for this post.
11/20/2020 at 6:26 PM #151080the import of the ITF code does not work .. am I the only one?
11/20/2020 at 6:38 PM #15108111/20/2020 at 6:52 PM #151082thank you for reply,
I load the file as usual.
here is the error message attached (French language).
I restarted PRT to rule out this failure hypothesis.
I have experimented with other ITF codes, it works. Strange isn’t it ..11/20/2020 at 7:21 PM #15108611/20/2020 at 7:43 PM #151088this time I restarted the computer to remove a doubt.
but that did not change the download error.however the function accepts to load other codes … really curious …
i would like to see this code, can you put the code as text please? thanks again.11/20/2020 at 7:44 PM #15108911/20/2020 at 9:47 PM #151096There you go …
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165// Dax - 1H// Original idea by lisamitch50 on prorealcode.com//*******************// Paramètres du codeDEFPARAM CumulateOrders = False // Cumul des positions désactivéDEFPARAM PRELOADBARS = 50000//Trading hours// Empêche le système de placer de nouveaux ordres sur les jours de la semaine spécifiésdaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0//----------------------------------------------------//*********************// VariablescLengthNb = 15bLengthNb = 3//-----------------------------------------------------//**********************// Hammers and inverted hammers (aka pin bars)body = max(open, close) - min(open, close)LowerShadow = min(open, close) - lowUpperShadow = high - max(open, close)// Minimum Length for the whole candle (shadows included)if high - low >= cLengthNb thencandleLength = 1elsecandleLength = 0endif//graph candleLength as "candleLength"// Minimum length for the body (from open to close)if body >= bLengthNb thenbodyLength = 1elsebodyLength = 0endif//graph bodyLength as "bodyLength"// If Lowershadow is at least 3 times the body length and the UpperShadow is at most half the length of the LowerShadow then it's a hammerif (LowerShadow >= 3 * body) and (UpperShadow <= LowerShadow * 0.5) and candleLength and bodyLength thenHammer = 1HamHigh = highHamLow = lowelseHammer = 0HamHigh = 0HamLow = 0endifgraph Hammer as "Hammer"// If UpperShadow is at least 3 times the body length and the LowerShadow is at most half the length of the UpperShadow then it's an inverted hammerif (UpperShadow >= 3 * body) and (LowerShadow <= UpperShadow * 0.5) and candleLength and bodyLength thenInvertedHammer = 1HamHigh = highHamLow = lowelseInvertedHammer = 0HamHigh = 0HamLow = 0endifgraph InvertedHammer as "InvertedHammer"//---------------------------------------------------------//*********************// Pinbar must close below the body of the previous candle to allow buyingif close < min(open[1], close[1]) thenbelow = 1elsebelow = 0endifgraph below as "below"// Pinbar must close above the body of the previous candle to allow sellingif close > max(open[1], close[1]) thenabove = 1elseabove = 0endifgraph above as "above"//------------------------------------------------------//***********************// Close of the pinbar must be within the 61.8%-100% range (/!\ some changes to make if there are two tails)candle = high - low// LowerShadowif LowerShadow >= candle * 0.618 thenFiboRangeHam = 1elseFiboRangeHam = 0endifgraph FiboRangeHam as "FiboRangeHam"// UpperShadowif UpperShadow >= candle * 0.618 thenFiboRangeInvHam = 1elseFiboRangeInvHam = 0endifgraph FiboRangeInvHam as "FiboRangeInvHam"//----------------------------------------------------//********************// Useless condtition for testsif Hammer or InvertedHammer or HamHigh or HamLow or above or below or FiboRangeHam or FiboRangeInvHam thenendifMyRSI = RSI[14]if myRSI > 99 thenVosconditions = 1endif//--------------------------------------------------------------//*********************// Conditions to go long// If it's a hammer, that close is below the body of the previous bar and that it's within the 61.8%-100% range thenIF NOT LongOnMarket and not daysForbiddenEntry and Hammer and below and FiboRangeHam THEN//BUY 1 CONTRACTS AT MARKETEntryPrice = highBUY 1 CONTRACT AT EntryPrice STOP // pending orderlossNb = candle + 10profitNb = candleset stop pLoss lossNbset target pProfit profitNba = 1followingBarsUp = 4 // allows 3 bars after that one to reach 100% Fibo and go longmoney = strategyprofitENDIFgraph a as "a"followingBarsUp = followingBarsUp - 1graph followingBarsUp as "followingBars"if strategyprofit <> money thenfollowingBarsUp = 0endifif followingBarsUp = 0 then // if the conditions to go long were true 4 bars ago but no longer are, then going long is no longer alloweda = 0endifgraph a as "a"if not LongOnMarket and not daysForbiddenEntry and a = 1 and (followingBarsUp > 0) then // if the conditions were true 4 bars ago, then go longBUY 1 CONTRACT AT EntryPrice STOPlossNb = candle + 10profitNb = candleset stop pLoss lossNbset target pProfit profitNbendif// Conditions pour fermer une position acheteuseIf LongOnMarket AND VosConditions THENSELL AT MARKETENDIF1 user thanked author for this post.
11/20/2020 at 9:50 PM #151097Yeah good idea … copy and paste the above straight into backtest on your Platform!? 🙂
1 user thanked author for this post.
11/21/2020 at 4:08 PM #151140I find this code original and opening up possibilities. can the author make a version for sale or am I saying something stupid?
11/21/2020 at 4:32 PM #151142original and opening up possibilities.
So did you find out why you couldn’t import?
The Strategy is lisamitch50 and the code Author is BobOgden
Thank you to both for sharing your time, effort and ingenuity with us all.
1 user thanked author for this post.
11/21/2020 at 4:36 PM #151145well no, the mystery remains intact to this day …
11/21/2020 at 4:54 PM #15114711/21/2020 at 7:21 PM #151156Hey @bertrandpinoy, I have no clue as to why importing the algo proves to be an issue… I’ve tried importing it to my own system and it worked :/
I’ll try and add the code for short positions when I know more about lisamitch’s perspective (and if nobody’s done it before)
Thank you @GraHal, hopefully it’ll generate better profit with more accurate parameters
1 user thanked author for this post.
11/22/2020 at 11:36 PM #151248Morning all.
Well – I think its had a good load of chat great..
Ill try and attach a screenshot of the chart, but not sure if it will be allowed.
Firstly, thank you to all especially BobOgden for all your time on this, the code works for me, but is a loosing code at present.
Secondly, it is a hard one to code i am sure, im not a coder and will probably never be able to code it, Work for god knows how long, home, sort kids out, look at charts, sleep, up to do it all again the next day. I dont even get the weekends off to myself anymore as everyone has either been let go or isolating. So i am immeasurably grateful and thankful for all the efforts going into this.
Thirdly, I do think that this is a profitable strategy (Manual) but the need to automate is because i cant keep getting up at 2am on a wednesday after my PRT system has sent me an email or alarmed to set the trade, its slowly killing me and having to drop kids off at school then go to work is also taking it out of me.
So – Data:
30th September 2020, 1hr Chart (Loaded the code and ran it)
The green candle that it takes a trade on isn’t a pin bar candle, its a full bodied green candle (Normal Candle), so it looks like the strategy is taking trades on the candle thats forming a pinbar, but could then close as a normal candle.
The FIB should show on the candle, then the trade placed on the next candle when it breaks the low of the candle with the FIB on it. See second screenshot (If allowed) where i shall annotate the entry and exit from a trade i took.
I have a few days off at the end of this coming week, so i shall try and create a video and (If allowed) pop a link up to it.
Keep up the great efforts and work guys, and honestly, if you manually trade this, it will make money.
Additional info for the second screenshot:
Wednesday 18th Nov @1500hrs – Pin Bar candle closes. FIB drawn from top to bottom of that candle. Trade set at the same time (Order to enter short) @ 13170.00 (I like rounded up / down numbers) SL (Stop) set to 13220.00, 50 point stop, £3pp trade. Alarm set at 250% FIB at 13108, where i take 75% off and stop moved to BE + 10 points.. Alarm set for 300% and 400% FIB. I closed the rest of the remaining trade at the 400% FIB point @ 13044 for 126.4 point move in total.
The main point is that you DONT enter the trade as the pinbar candle closes, you need to set an order to open a few points below / above the 100% FIB line, that way the trade has a better chance of getting to the 1st target (250% FIB). If you open a trade based on the candle alone, the probability of it being a winner reduces dramatically.
I hope all this makes sense.
Mitch
-
AuthorPosts
Find exclusive trading pro-tools on