activate a trade

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #60589 quote
    George65
    Participant
    Senior

    Hi,

    Can anyone help, please if it is possible to activate a trade during the current bar, if the condition is met (for example if you have a higher high than the previous bar)? I can only find “next bar open”.

    Kind regards

    George

    #60590 quote
    Eric
    Participant
    Master

    try

    Buy at “x” STOP

    instead of Buy at MARKET

    #60596 quote
    George65
    Participant
    Senior

    Thanks Eric!

    Could you explain in more detail how this command is!? Buy at “high[0] is greater than high[1]”STOP?

    Sorry, if it’s too naive…

    George

    #60598 quote
    George65
    Participant
    Senior

    I’ve made a try, thanks.

    Tha command was good, I mean it was executed. But it brought the same result like buy at market. And it activates the trade one bar later

    George

    #60608 quote
    robertogozzi
    Moderator
    Master

    Thanks Eric! Could you explain in more detail how this command is!? Buy at “high[0] is greater than high[1]”STOP? Sorry, if it’s too naive… George

    This command makes no sense, since it means BUY AT true/false STOP, where true/false is a logical datum not a price!

    You can write BUY AT HIGH[0] STOP or BUY AT HIGH[1] STOP/LIMIT.

    Roberto

    #60624 quote
    George65
    Participant
    Senior

    Thank you Roberto!

    #60640 quote
    George65
    Participant
    Senior

    Dear Roberto,

    It is interesting! I use the same code in the screener and in the trading system. I ask for green arrow in the screener if the condition is met, and the arrow is placed under the right bar. I coded ‘BUY at  HIGH[1] STOP’  but it is still executed one bar later (blue arrow made by the system), than the green arrow.

    According to the strategy ‘bar1’ is the setup bar, ‘bar0’ is the entry bar if the entry bar has one tick higher high than the setup bar. This is a short term strategy, so it is important to act when it has to.

    And the system acts one bar after the entry bar.

    Any idea?

    Thank you

    #60649 quote
    robertogozzi
    Moderator
    Master

    Bar[0] is the setup bar, the entry bar cannot be referenced till it closes.

    #60650 quote
    robertogozzi
    Moderator
    Master

    Screener behaves differently because it scans the market at any time, even when a candle is being built, while Proorder runs strategies only when a candle closes, right before the new one opens, then it takes a breath till it closes and so on…

    George65 thanked this post
    #60660 quote
    Eric
    Participant
    Master

    Try something like this

    the 0.6 is for the spread (1 point in this case) because the chart in prorealtime shows the price and its bid and ask that execute the trade

    and another thing to be aware of is the minimum stop distance , if proorder try to place a stop to buy to close to the pevious high (or something else) it will be rejected and the tradingsystem will be stopped and needs to be restarted again

    donh = HIGHEST[1](HIGH)+0.6* pipsize
    
    IF NOT LongOnMarket THEN
    BUY 1 Contracts AT donh  STOP
    ENDIF
    
    
    donl = LOWEST[1](LOW)-0.6* pipsize
    
    IF LongOnMarket THEN
    SELL AT donl  STOP
    ENDIF
    #60663 quote
    Eric
    Participant
    Master

    About this minimum stop distance

    a stop order is always checked and maybe moved at the end of the bar and be placed at the new bar open (the current level are valid 1 bar)

    so if the current price (at the end of the bar) is to close to the new stop level it will be rejected

    #60692 quote
    George65
    Participant
    Senior

    Thank you Eric, I will try this. My point is that the strategy is expected to be calculated on each incoming tick, and not only at the close of the certain bar. For example if you’re on an hourly timeframe, and the condition is met in the 5th minute, the trade should be executed right then and not at the next bar open. If I mean well Roberto’s words ProOrder is able to run strategies when a bar is closed.

    Thanks again

    George

    #60838 quote
    Nicolas
    Keymaster
    Master

    Calculation will not be made at each tick, only one time at Close.

    #60880 quote
    George65
    Participant
    Senior

    Thanks for the confirmation Nicolas! Maybe in the future?

    #60884 quote
    Nicolas
    Keymaster
    Master

    Yes! It should take place this year hopefully.

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.

activate a trade


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
George65 @george65 Participant
Summary

This topic contains 15 replies,
has 4 voices, and was last updated by George65
8 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/26/2018
Status: Active
Attachments: No files
Logo Logo
Loading...