BUY or SELL in the actual bar is possible?
Forums › ProRealTime English forum › ProOrder support › BUY or SELL in the actual bar is possible?
- This topic has 18 replies, 6 voices, and was last updated 6 years ago by Marke.
-
-
12/06/2017 at 6:44 PM #54910
Hi,
I want to know if it’s possible to buy or sell in the same bar that I check the conditions.
At the moment, I can only buy or sell on the next bar, so I have one bar delay in my system.
It’s easy to check, just with a var that I GRAPH in the backtest. Also I can see that in real.
It’s there a way to avoid this??
Thanks in adavance
12/06/2017 at 8:50 PM #54916There is no way around this delay. During a bar only stop and limit orders are executed (which have to be set before the bar begins). Nothing else would be possible anyway since PRT evaluates your code just once at the close of every bar. During the bar nothing is going on.
12/06/2017 at 9:46 PM #54922Thank you, I’ve been trying to avoid this, but as you said, it’s impossible.
Nothing else would be possible anyway since PRT evaluates your code just once at the close of every bar. During the bar nothing is going on.
Ok, but after the evaluation, PRT could simply send the order at market, just that, looks so simple….
I insert a var in the code and show on screen with GRAPH, and it’s one bar before the order. I really don’t like this at all
12/07/2017 at 10:30 AM #5495012/07/2017 at 12:33 PM #54972There are two possible Solutions:
- Despair has already said: in the previous candle open orders like “buy 1 contract at XXX stop”, XXX is the Price where the conditions will be meet in the current candle
- Create an strategy in shorter time Frame: for example a Moving Average of 20 periods in a 1h time Frame Looks very similar to a Moving Average of 40 periods in a 30min time Frame
Someone else knows another approach?
12/07/2017 at 3:03 PM #54987There are two possible Solutions:
- Despair has already said: in the previous candle open orders like “buy 1 contract at XXX stop”, XXX is the Price where the conditions will be meet in the current candle
- Create an strategy in shorter time Frame: for example a Moving Average of 20 periods in a 1h time Frame Looks very similar to a Moving Average of 40 periods in a 30min time Frame
Someone else knows another approach?
Despair option it’s the same problem, you are sending the order 1 candle after you check the conditions.
The strategy works well in the timeframe I create it for, don’t want to change, because PRT does not have multitimeframe.
Maybe multitimeframe it’s dificult to program, but sending the order AT THE MOMENT I get the signal should be really easy.
I will leave PRT as soon as possible
12/07/2017 at 3:08 PM #5498812/07/2017 at 3:21 PM #54989If you could explain a bit what is your condition, we could try to find something to better suit your trading style. Is is based on indicators or only price itself?
It’s based on indicators.
I just want to buy or sell, open or close positions when I want. I can’t understand why I have to wait one full candle to send the order, or change the stop loss or the take profit. So many good strategy are wrong because of this.
Let’s say you have an average, ando you are checking the change of direction…
123456m= average[40](close)changeup = m[2]>m[1] and m[1]<mif changeup THENbuy at marketENDIFThat code will buy 2 bars after the change. One it’s ok, as you have to wait for the candle to close and check, but the second candle….
12/07/2017 at 7:57 PM #55008You are right. But if your strategy only rely on moving averages, you can use period multiplier in inferior timeframe to get values from the superior ones. That way you can interact between bars, this is just a simple workaround before we get the multi timeframe support..
12/08/2017 at 12:24 PM #55098You are right. But if your strategy only rely on moving averages, you can use period multiplier in inferior timeframe to get values from the superior ones. That way you can interact between bars, this is just a simple workaround before we get the multi timeframe support..
It’s not only averages, so it’s dificult to adapt. And as you already know, a period multiplier it’s not exactly the same.
Multitiframe it’s a must
Intermarket it’s a must
AND why CAN’T I send an order at the moment?? Why?? I really can’t understand this
12/08/2017 at 1:01 PM #55099I feel you upset SickBoySpain,
Your code will exclty work if you reduce the time frame by half and increase the period by 2.
Another possibility is to think more deep into the mathematics of code, you can know far in advance if the slope of your moving average will Change ist slope. (unless North Korea attacks Usa or something very strange in the bar will happend)
In any case, let us know if you get a profitable code in a so symple way.
12/08/2017 at 3:06 PM #55127I feel you upset SickBoySpain, Your code will exclty work if you reduce the time frame by half and increase the period by 2. Another possibility is to think more deep into the mathematics of code, you can know far in advance if the slope of your moving average will Change ist slope. (unless North Korea attacks Usa or something very strange in the bar will happend) In any case, let us know if you get a profitable code in a so symple way.
Mi code it’s not about medium average, and this problem it’s not about the code, it’s about that I have to wait one extra bar to enter or exit the market
Why do I have to wait if I already have the signal??
If I want to make a 4H strategy, do I have to wait 4 Hours to enter the market??
In a daily strategy, wait 1 DAY!!!
I simply don’t understand
12/08/2017 at 3:11 PM #55128I feel you upset SickBoySpain, Your code will exclty work if you reduce the time frame by half and increase the period by 2. Another possibility is to think more deep into the mathematics of code, you can know far in advance if the slope of your moving average will Change ist slope. (unless North Korea attacks Usa or something very strange in the bar will happend) In any case, let us know if you get a profitable code in a so symple way.
And no, you can’t reduce the time frame and increase the period and get the same results.
Try it, and you will see that it’s not correct
12/08/2017 at 8:39 PM #55192What about this idea:
You know for example a 4-hour bar starts at say 14:00 and you want to enter half an hour later, so just hardcode
if current time==14:30 buy a contract – and sell one hour later if current time==15:00 sell the contract.
Something like this should be possible.
12/08/2017 at 8:43 PM #55193Won’t work, the condition in your example will never come true. The code is only evaluated att the end of each bar. Both 14:30 and 15:00 are never seen by your code. It will be checked once every 4 hours.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on