A trade when mid price reached

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #55437 quote
    Siegfried Legeay
    Participant
    New

    Hi, 

    I was wondering if it was possible to have an order that only executes at market price only when it is the mid that hits the price required and not either the bid or the ask?

    Thanks in advance.

    #55495 quote
    Nicolas
    Keymaster
    Master

    Are you talking about ProOrder (automatic trading) orders?

    #55529 quote
    Derek
    Participant
    Veteran

    Hi Sigfried,

    the problem with that idea is the existence of a spread. You will never get that middle price. If spread=1 and you want your market price to be 10 when the middle price is 10 then 9,5 is the order level for you.  Really not sure if that’s what you want, but possible. The shorter your timeframe the less likely will your order be filled. Accounting for different spreads during the day is possible and code snippets are easy to do (or can be found in the forum and the library).

    If it helps your analysis you can also create a price indicator that substracts (or adds) the current spread from the actual price.

    Either way, the spread can change due to unexpected above average volatility. I don’t know of any way to retrieve the current spread from your broker direct.

    Hope this helps.

    #88618 quote
    Precision
    Participant
    New
    Does any code exist in ProRealcode to call the bid and ask prices? The issue I am having is when using a Parabolic SAR type indicator for my strategy which flips over when the trend changes, my chart (and SAR) are showing AND reading from the mid price from IG index but the trades are being triggered by the bid and ask. The two are not in alignment and can have potentially catastrohic results. My code is using high and low, but it needs to get high of ask and low of bid In the shot below the actual account when short but he strategy did not, this is due to the above. Any solutions out there?
    bad_trade.png bad_trade.png
    #89023 quote
    David
    Participant
    Veteran
    @Precision there’s no code that can request the bid/ask price. @Derek Re: “If it helps your analysis you can also create a price indicator that substracts (or adds) the current spread from the actual price.” I’m guessing you actually didn’t mean the “current spread” because like you stated we can’t get that information live through PRT. I guess you meant that you can estimate the bid/ask based on mid priced displayed on PRT based on the average suggested spread from IG.
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

A trade when mid price reached


Platform Support: Charts, Data & Broker Setup

New Reply
Author
Summary

This topic contains 4 replies,
has 5 voices, and was last updated by David
7 years, 1 month ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 12/11/2017
Status: Active
Attachments: 1 files
Logo Logo
Loading...