Move to BE on Confirmation of Market Structure
Forums › ProRealTime English forum › ProOrder support › Move to BE on Confirmation of Market Structure
- This topic has 19 replies, 4 voices, and was last updated 3 years ago by Steveaw.
-
-
06/30/2020 at 10:11 AM #137646
Ah ok I guess it doesn’t matter which but let me take a look at them using gold spot/USD is that ok?
Probably change the entry onto a higher timeframe as well just to get into a trade.
Quick question though (and you have probably realised by now that I’m a coding numpty!) how does the code know what SigHI1 is and how does this increase(lines 51 & 54 in my code version above)?
Also on line 51 where SigHI > 0 would I be able to to substitute 0 for a higher integer value say 20 to represent 20 pips in profit or is it just a 1-0 true – false statement?
Forgive me for my lack of understanding!
Steve
06/30/2020 at 12:17 PM #137683Don’t worry, newbie ISN’T numpty! (the same as Expert ISN’T smart!)
GraHal ‘s motto is “Ask a question, you may be a fool for a day. Don’t ask a question, you may be a fool for life!? ” and I subscribe to it!
that 0 is just a logical statement (true-false), 0=FALSE whichever value other than 0 is true.
But… what proves GraHal is right is just in your lines 51-54. Checking them I just realized a made a HUGE mistake in my first post, where I used logical values to compare higher and lower swing points.
Thanks for spotting that Steveaw.
This is the correct (?!) version of my first post:
12345678910111213141516171819202122232425262728293031ONCE SwingHI1 = 0ONCE SwingHI = 0ONCE SwingLO1 = 0ONCE SwingLO = 0ONCE LookBack = 10IF Not OnMarket ThenMySL = 0ENDIFMaxHI = max(open,close)MinLO = min(open,close)Bullish = close > openBearish = close < openSwingHI = highest[LookBack](MaxHI)SwingLO = lowest[LookBack](MinLO)SigHI = SwingHI AND Bearish AND Bullish[1]SigLO = SwingLO AND Bullish AND Bearish[1]IF LongOnMarket AND SigHI > 0 AND SwingHI > SwingHI1 THENSwingHI1 = SwingHIIF SwingHI1 > SwingLO1 THENMySL = max(TradePrice,max(MySL,SwingLO1))ENDIFELSIF ShortOnMarket AND SigLO > 0 AND SwingLO < SwingLO1 THENSwingLO1 = SwingLOIF SwingLO1 < SwingHI1 THENMySL = min(TradePrice,min(MySL,SwingHI1))ENDIFENDIFIF OnMarket AND MySL <> 0 THENSELL AT MySL StopEXITSHORT AT MySL StopENDIFI’m so sorry you will have to change your strategy again!
1 user thanked author for this post.
06/30/2020 at 1:47 PM #13770406/30/2020 at 3:34 PM #137751Please post your last used code.
07/03/2020 at 5:23 PM #138322TAKE PROFITS AT BREAK OF MARKET STRUCTURE Test 3123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172// Hi Roberto - I've attached the code and another screenshot on XAU/USD//Steve// Solution from PRC For Finding a BOS5//TAKE PROFITS AT BREAK OF MARKET STRUCTURE Test 3//-------------------------------------------------------------------------// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivateddaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0if onmarket or strategyprofit<>strategyprofit[1] thenflag = 1endifif dayofweek <> dayofweek[1] thenflag = 0endifentry=1751SET STOP pLOSS slSET TARGET pPROFIT tpsl=10tp=50// Conditions to enter long positionnotradetime1=213000notradetime2=233000notradetime=time>notradetime1 and time<notradetime2timeframe (60 minute, updateonclose)c1=low<=entrytimeframe(default, updateonclose)IF not daysForbiddenEntry and not flag and not onmarket and not notradetime and c1 ThenBuy 1 perpoint AT MARKETENDIF// from PRCtimeframe (60 minutes, updateonclose)ONCE SigHI1 = 0//ONCE SigHI2 = 0ONCE SigLO1 = 0//ONCE SigLO2 = 0ONCE LookBack = 5IF Not OnMarket ThenMySL = 0ENDIFMaxHI = max(open,close)MinLO = min(open,close)Bullish = close > openBearish = close < openSwingHI = highest[LookBack](MaxHI)SwingLO = lowest[LookBack](MinLO)SigHI = SwingHI AND Bearish AND Bullish[1]SigLO = SwingLO AND Bullish AND Bearish[1]IF LongOnMarket AND SigHI > 0 AND SigHI > SigHI1 THEN//SigHI2 = SigHI1SigHI1 = SigHIIF SigHI1 > SigLO1 THENMySL = max(TradePrice,max(MySL,SigLO1))ENDIFELSIF ShortOnMarket AND SigLO > 0 AND SigLO < SigLO1 THEN//SigLO2 = SigLO1SigLO1 = SigLOIF SigLO1 < SigHI1 THENMySL = min(TradePrice,min(MySL,SigLO1))ENDIFENDIFIF OnMarket AND MySL <> 0 THENSELL AT MySL StopEXITSHORT AT MySL StopENDIF -
AuthorPosts
Find exclusive trading pro-tools on