How to enter and exit the market at each big pic ?
Forums › ProRealTime English forum › ProOrder support › How to enter and exit the market at each big pic ?
- This topic has 18 replies, 4 voices, and was last updated 4 years ago by
Vonasi.
-
-
02/18/2021 at 1:10 AM #161865
How to enter and exit the market at each pic ?
While you are in a bar or candlestick (in 60 seconds) – when it has a big pic ( alpha=up or omega=down) of a certain value(X=10 to 100 PIP) of the exchange rate – how can you program the buy (if pic goes up) or sell (if pic goes down) and exit directly after (in the same bar or in 1 minute)?
See Image with the blue circles on the pics.
Thanks !02/18/2021 at 8:57 AM #161887Topic moved in the English section of the forum (you posted in the french one).
I think you are talking about the tail and nose of the candlestick (not pic).
The size of the tail and nose can’t be known before the candle is closed, so what you want is detect the difference between the high – max(open,close) and the min(open,close) – low, during the life of the bar, is that right?
02/18/2021 at 9:28 AM #16189302/18/2021 at 1:02 PM #161915the code is:
1234567timeframe(5 minutes) //timeframe of the bar, use whatever the one you wantupper = high – max(open,close)lower = min(open,close) – lowtimeframe(default)//add below what you want to do with that values// example: if upper>10*pointsize then ... endif02/18/2021 at 6:05 PM #161945Thanks for the code, well it doesn’t work according to the logic of the strategy.
Here’s how it works already. And we want your help to perfect it as desired (see my question).1234567891011121314151617//----------------------------------------ONCE Pic = 50 // variation : 10 to 100indexBar = 0WHILE IntradayBarIndex > indexBar DOupper = ABS(Open - High)lower = ABS(Open - Low)IF upper >= Pic AND ....... THEN.....BUY........ELSIF lower >= Pic AND ....... THEN.....SELL....................ENDIFindexBar = indexBar + 1WENDThanks for yours suggestions.
02/18/2021 at 9:56 PM #161952macdopa – Please be more careful when posting any future posts. Your post was a HTML mess that needed tidying up by moderators as you had your comments within the inserted PRT code box.
You have 5 minutes after submitting any post to delete or edit it if it does not look right.
02/19/2021 at 9:09 AM #161971I think that your logic is wrong.
1/ you are using a loop to scan all candles of the day, even ones far from the current period, why? How would it be possible to trade in the past? 😀
2/ I might be wrong, but you are computing the wrong way the tail/nose size, you are using open of the candle for both sides of the candlesticks, the definition I used is the right way to get the sizes of the tail/nose, no matter if close>open or close<open.
Please have a second look to the code I gave above, it uses the 5 minutes bar to get the wick/nose size. This calculation is made 1 time each “default” timeframe, which can be the 1-minute one for instance.
So basically, during the 10:05:00 candlestick, if at 10:03:00 the tail is > 10 points, an order is launched (we act during the candlestick formation). But, you should now that if at the closure of the 10:05:00 candlestick the tail isn’t > 10 points, it doesn’t mean it never been during the life of the candle! And that’s what you see on an history chart that only show you closed bars.
02/19/2021 at 1:27 PM #161985My logic is good and it works, but I still need to make it better: It consists in taking advantage in each bar (candlestick) in the timeframe of 1 minute (60 seconds) which presents great Ticks.
1/ you use a loop to scan all the candles of the day, even those that are far from the current period, why? How would it be possible to exchange in the past? 😀
ANSWER: The loop runs in each candle and so on when a big gap between Ask and Bid is found. After that, we move on to the next candle (in progress) .2/ I could be wrong, but you calculate the candle tail/nose size in the wrong way, you use the candle opening for both sides of the candlesticks, the definition I used is the right way to get the tail/nose sizes, it doesn’t matter if close>open or close<open.
ANSWER: It already works with my formula. In yours, the price-close is the problem; because, when you’re still in the bar, the closing price is not yet known. Now, according to my logic, the take-profit set must be realized before the end (close) of the candle (according to the timeframe).I think that, now, with your expertise, you will improve the code well in order to take advantage of the bounce of the big Tick to launch the corresponding order (in the opposite direction of the variation of the Tick) and exit directly after Take-profit.
NB: The Take-Profit varies from 20 to 100 PIP for Forex and from 100 to 300 PIP for Crypto-money.02/19/2021 at 1:39 PM #1619861/ that point is not clear to me sorry, I dont understand why you are looping through the previous bars? Are you looking in “big gap” from the previous bars in order to trade in the current one?
2/ Close price is the current price, during a candlestick, that’s why I’m using it in the code 🙂
02/19/2021 at 2:19 PM #1619901/ that point is not clear to me sorry, I dont understand why you are looping through the previous bars? Are you looking in “big gap” from the previous bars in order to trade in the current one?
(=NO. In the current bar, with the WHILE control, if you spot a big gap, then you launch the corresponding order and exit as soon as the profit is reached).2/ The closing price is the current price, during a candlestick, that’s why I use it in the code 🙂.
(OK for the price-Close)02/19/2021 at 3:27 PM #1620061/ your loop is not necessary here, i’m sorry.
Code is read only just one time during a bar, so in order to do something during the bar, we have to use an inferior timeframe.
Here is the strategy code that is read 300 times during a 5-minutes bar by launching it on a 1-sec timeframe:
tested in a 1-sec timeframe1234567891011121314151617181920212223242526defparam cumulateorders=falsetimeframe(5 minutes) //timeframe of the bar, use whatever the one you wantupper = high - max(open,close)lower = min(open,close) - lowgreen = close>openred = close<opentimeframe(default)size = 5 //size of nose/wickif not onmarket thenif upper>size*pointsize and green thenbuy 1 contract at marketendifif lower>size*pointsize and red thensellshort 1 contract at marketendifendifset target pprofit 20set stop ploss 10graph upper coloured(0,200,200)graph lower coloured(200,200,0)graph sizeLook at attached picture in order to understand how it works, please.
02/19/2021 at 6:00 PM #16202902/19/2021 at 7:43 PM #16204202/19/2021 at 7:58 PM #16204402/19/2021 at 8:00 PM #162045 -
AuthorPosts
Find exclusive trading pro-tools on