Topic: FSB/FST trading discrepancies - Markup

I am running FST live and it entered a long trade but according to the rules it shouldn't have done. If I run the data back over FSB it doesn't enter the trade. The levels are very close. The trade should be triggered if the bid price reaches 1.25217 (see 1st chart below). The actual low price was 1.25219 but FST sent a long order without the price being hit (see 2nd chart). I know it's only .00002 out but that cost me $498! Any Ideas.



http://s17.postimage.org/samtt73gr/Snap_2012_06_26_12_52_47_002.jpg


http://s18.postimage.org/c9kq40tdx/Snap_2012_06_26_12_52_11_001.jpg

Re: FSB/FST trading discrepancies - Markup

Sorry to hear that. Do you have variable spread in your account? What about the same bar in MT, what readings does it give in MT for 5:30?

Re: FSB/FST trading discrepancies - Markup

The spread does vary if that's what you mean. But regardless of that the bid price didn't get down to the level so I don't understand  why FST initiated a trade.

The MT bar is identical to the FSB bar.

Re: FSB/FST trading discrepancies - Markup

According to the formulas FST shouldn't have opened a long trade.

micron = Data.InstrProperties.Point / 2d;

double basePrice = Configs.LongTradeLogicPrice == "Bid" ? Data.Bid    : Data.Ask;
double oldPrice  = Configs.LongTradeLogicPrice == "Bid" ? Data.OldBid : Data.OldAsk;

bool canOpenLong = (buyPrice > oldPrice  + micron && buyPrice < basePrice + micron) ||
                   (buyPrice > basePrice - micron && buyPrice < oldPrice  - micron);

Long entry is possible only when Current Bid or Previous Bid were less than 1.252175.

FST doesn't accumulate ticks in order to build bar's High and Low prices. Low price comes from the chart's Low. I'm not sure is it possible to have a bid tick below 1.25219 that was not recognized as a bar Low.

Re: FSB/FST trading discrepancies - Markup

By variable spread I mean the spread is not fixed, it's floating in other words.

But now to the point: just recently I found out that if the trading account has variable spread, MT chart doesn't show actual bid price (if chart is set to show bid price, of course)! In my example I found out that actual bid price is .3 points below the price value on the chart! From the code posted above (thank you Miro, I was just thinking of asking it) I see, that position opening calculation is done upon actual bid price, so my theory is that the price value on the chart does NOT correspond to actual bid price, therefore bid price did touch the lower band and the triggered trade was correct.

Spiderman, please make a screenshot of your MT screen, then compare the price value on the chart to the actual bid price value in Market watch window.

Re: FSB/FST trading discrepancies - Markup

So what happened was the bid price may have reached the low price but it never actually traded there. As soon as FST saw the bid price at the level it place the buy order which was filled at the ask price which in this case was 1.25240.  Spread plus slippage 1.25240 - 1.25217 = 2.3 pips which would seem about right.

I suppose the recorded prices are traded prices rather than bid prices, maybe.

Re: FSB/FST trading discrepancies - Markup

SpiderMan wrote:

... maybe.

Why speculate? Compare chart price value to the actual bid price value, if they differ, then how much.

Re: FSB/FST trading discrepancies - Markup

If that difference is >= 0.00002 you have your answer to your trade. Why chart price is not bid price is question to brokers, somehow it seems to be beneficial to them. But my opinion is  that price at 217 was quoted by broker, therefore it was tradeable price.

Re: FSB/FST trading discrepancies - Markup

FST trades according to Bid and Ask from MT. It doesn't use Open, High,  Low, or Close. Chart prices are for calculating of the indicators.
Expert sends trading prices with this code:

double bid = MarketInfo(symbol, MODE_BID);
double ask = MarketInfo(symbol, MODE_ASK);

These prices go to FST as Bid and Ask (Data.Bid and Data.Ask) without any conversion.

There is no way FST to send order if Bid doesn't touch or breaks through the required indicator entry level.

Re: FSB/FST trading discrepancies - Markup

footon wrote:
SpiderMan wrote:

... maybe.

Why speculate? Compare chart price value to the actual bid price value, if they differ, then how much.

This is becoming more interesting. I have accounts with 2 brokers and I am running the same system on both. One broker didn't execute the trade, the other did. As you suggested Footon, I compared the actual bid price with the price on the chart. With one broker it is identical and the bid price is the same as the chart price, with the other the bid price is actually a constant 0.6 pips lower than the price on the chart, this is why my .2 pips difference was enough to trigger the trade.

The question I why the difference, the spreads look the same?

Re: FSB/FST trading discrepancies - Markup

SpiderMan wrote:

This is becoming more interesting. I have accounts with 2 brokers and I am running the same system on both. One broker didn't execute the trade, the other did. As you suggested Footon, I compared the actual bid price with the price on the chart. With one broker it is identical and the bid price is the same as the chart price, with the other the bid price is actually a constant 0.6 pips lower than the price on the chart, this is why my .2 pips difference was enough to trigger the trade.

The question I why the difference, the spreads look the same?

Yeah, I was pretty puzzled when I discovered the difference. For my variable spread account, bid is 0.3 lower and that distance is 90% of the time there, it seems almost like a fixed spread to me. There has to be a catch why broker is doing this, but I haven't figured it out yet.

It is very interesting news that your other broker quotes bid on chart correctly. Is it dirty vs honest broker here?

Re: FSB/FST trading discrepancies - Markup

Is option "Show Ask Line" from Tools - Chart of MT4 menu activated? I'm not sure what it is doing, but it sounds to me that the chart should show Ask prices.

Ears ago some brokers were drawing middle price chart (Bid + Ask) / 2 instead of Bid charts.

Re: FSB/FST trading discrepancies - Markup

The plot thickens!

I have turned on the ASK line in the options and it doesn't display. Below is a screenshot of MT4 with the trading window up which clearly shows the bid price on the chart as 0.6 pips higher than the bid price in the trading window. The bid/ask spread is 2.4 pips so the price line is not the middle price.


http://s13.postimage.org/cwt9yfugj/Program_Manager_2012_06_27_14_55_33.jpg

Re: FSB/FST trading discrepancies - Markup

I turned ask line on, it showed up, but still not near the real ask line.

http://s12.postimage.org/6spxhptsp/ask_line.jpg

I'll ask my broker.

Re: FSB/FST trading discrepancies - Markup

Got the answer fairly quickly, it is called markup, additional fee broker gets from us on top of spread.

Explanation here: http://www.investopedia.com/terms/m/mar … z1yzPqbtH7

Re: FSB/FST trading discrepancies - Markup

And again we have to workaround brokers' pitfalls.

My first idea for a solution is to introduce a new option in
Trade Settings -> Long logic rule base price -> Close

The current default option value is "Bid". It means that when Bit price touches the entry level, FST sends an order.
"Close" option will check when Close price touches the entry level. Close price must be what MT4 sends for last chart value. The real deal will be executed at the actual trading prices.


Code for basePrice and oldPrice will be something like that:

double basePrice;
double oldPrice;

switch (Configs.LongTradeLogicPrice)
{
    case "Ask":
        basePrice = Data.Ask;
        oldPrice = Data.OldAsk;
        break;
    case "Close":
        basePrice = Data.Close[Bars-1];
        oldPrice  = Data.OldClose[Bars-1];
        break;
    default: // case "Bid":
        basePrice = Data.Bid;
        oldPrice = Data.OldBit;
        break;
}

Any comments?

Re: FSB/FST trading discrepancies - Markup

Popov wrote:

Any comments?

I would have thought that closing prices would have been covered by the logic slots. In this case we are looking to trade if a level is touched rather than where the close is. Maybe in trade settings add a "broker markup" option to add or subtract an offset. With the broker shown in my screen shots it is 0.6 pips.

Re: FSB/FST trading discrepancies - Markup

I would have thought that closing prices would have been covered by the logic slots.

I mean close price of current bar. MT4 shows the last tick price as bar close even if it is in the middle of the bar's time span. Normally Close = Bid but in your case Close = Bid  + Markup.

I already made a new version of FST with this features, but cannot test it properly since my broker doesn't use Markup. I'll publish the new version in Developers forum in minutes. Markup info will be available in the Market Info window.

Re: FSB/FST trading discrepancies - Markup

A testing version with this option is published here: FST 1.4.11 Nightly Build

Re: FSB/FST trading discrepancies - Markup

SpiderMan wrote:
Popov wrote:

Any comments?

I would have thought that closing prices would have been covered by the logic slots. In this case we are looking to trade if a level is touched rather than where the close is. Maybe in trade settings add a "broker markup" option to add or subtract an offset. With the broker shown in my screen shots it is 0.6 pips.

Not a good idea I'm afraid as my markup went from 0.3 to 0.5, something tells me "the best" is yet to come...

Re: FSB/FST trading discrepancies - Markup

When we lost a trade, we investigate the reasons and try to correct the strategy or software.
When broker lost a trade, he investigate the reasons and changes the rules.

Re: FSB/FST trading discrepancies - Markup

Markup can be included in an indicator for FST. Its values are not collected in an array but the current value is available with the following code:

double Markup = Data.LastClose - Data.Bid; // As price. Ex. 0.00003

double Markup = Math.Round((Data.LastClose - Data.Bid) / Data.InstrProperties.Point); // As points. Ex. 3

Re: FSB/FST trading discrepancies - Markup

The close option sounds like a good solution. I haven't even thought about it but I presume the same thing applies when entering a  short position.

Re: FSB/FST trading discrepancies - Markup

SpiderMan wrote:

The close option sounds like a good solution. I haven't even thought about it but I presume the same thing applies when entering a  short position.

Close option must be good for both directions. It fixes the markup issue. In English it sounds like that:
Enter long when last chart price touches or breaks through the indicator entry price. Actual order price is the broker's Bid for a short position and broker's Ask for a long position.

If there is no Markup, Bid = Close at any moment. (We have Bid charts.)
If broker uses Markup, Bid price is always below the chart's last price.

I think even to leave "Close" option to be the default one. It must work well in both cases.

Re: FSB/FST trading discrepancies - Markup

Yes, this is a perfect solution. I think FST is more robust with this change.