Code for stop expiry

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #99561 quote
    RiaanvN
    Participant
    Average

    Hi, I wish to enter trade only once previous bar high has been breached.

    So I coded the following: BUY 1 LOT AT high+1 STOP

    However I want this rule to be valid for one bar only, otherwise have stop order cancelled.

    Any ideas?

    #99562 quote
    robertogozzi
    Moderator
    Master

    Pending orders only last one bar, so you just need not place it again once entered.

    #99608 quote
    RiaanvN
    Participant
    Average

    Hi, thanks. The issue I have is that the code delays entry by one bar (close of bar). Do you know if it is possible to enter trade intrabar instead?

    #99609 quote
    robertogozzi
    Moderator
    Master

    When you place a pending order, a trade is entered as soon as the desired entry price is reached without having to wait the closure of a bar.

    It is not possible to enter AT MARKET while a bar is forming. In such case you may need to use the Multiple Time Frame support (MTF) that allows you to set as default a lower TF while still evaluating conditions on the higher ones. The lowest TF used is the one that sets the “pace” at which strategies are executed. So if you choose 1-minute TF you’ll be able to access any candlestick, no matter what TF, every minute. You’ll have a chance to decide whether entering a trade while conditions have not yet been confirmed or wait till the candle on the higher TF closes. In any case you can decide on a minute-by-minute basis.

    All TF’s used (up to 5+default) in a strategy must be multiple of the default (lowest) one. So if you want to use 1-minute, 1-hour and daily TF it’s ok, but you cannot use 7-minute, 1-hour and daily TF’s.

    #99615 quote
    RiaanvN
    Participant
    Average

    Ok, thanks man.

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

Code for stop expiry


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
RiaanvN @riaanvn Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by RiaanvN
6 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/28/2019
Status: Active
Attachments: No files
Logo Logo
Loading...