BUY or SELL in the actual bar is possible?

Forums ProRealTime English forum ProOrder support BUY or SELL in the actual bar is possible?

Viewing 15 posts - 1 through 15 (of 19 total)
  • #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

    #54916

    There 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.

    #54922

    Thank 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

    #54950

    At the close of the bar you can send a market order that will be executed at the open of the following bar.

    #54972
    Leo

    There 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?

    #54987

    There 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

    #54988

    If 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? 

    #54989

    If 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…

    That 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….

    #55008

    You 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.. 

    #55098

    You 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

    #55099
    Leo

    I 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.

     

    #55127

    I 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

    #55128

    I 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

    #55192
    AVT

    What 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.

    #55193

    Won’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.
    avatar AVT
Viewing 15 posts - 1 through 15 (of 19 total)

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