There are some problems entering and exit deals. For example I have a price 1.5784 and I want to enter on this price. When I entered I can see the price 1.5784 or 1.5783 or 1.5785. I think it's because double type stores price not in exact value, but consumes less memory. Could you tell me what to do? I want to see enters and exits exact the price I enter and exit.
Size:
Color:
Have you disabled commissions and slippage in Preferences?
Size:
Color:
Also, we have to look at these on a case-by-case basis depending on the order type, OHLC of the entry bar, etc. For example, it's completely correct for a limit order to be filled at a better price if the bar's open is lower/higher than your BuyAt/ShortAt Limit price.
Size:
Color:
Thank you for reply!
Look at Preferences. Commisions are off. In Slippage I set in For Equities box 0 value. For Futures I left 1 value. All checkboxes are not set. I just set the exact order I'd like to buy/sell. But sometimes buy/sell are on 1 tick below/above this order.
Size:
Color:
OK, it's not commissions and slippage. Let's see the OHLC, the order type, the relevant code.
Size:
Color:
OK, let's test it!
I check Bars.Close[bar] It gets me 1.9780999422073364 double value. In MetaStock this bar closes value is exactly 1.9781 I know that Double type gives me not exactly the value It has from MetaStock.
I assign this value to variable. No change, the same value. In some cases I move my Stop Loss order to this value. Stop Loss Variable dealStop has the same value.
I exit the deal:
CODE:
Please log in to see this code.
dealStop is still 1.9780999422073364 here. But I see Exit Price on Trades page as 1.9780, not 1.9781
Size:
Color:
Is the symbol defined in Symbol Info Manager?
Size:
Color:
Yes, it defined as:
Symbol: GBP
Type: Future
Margin: 1000
Point Value: 100
Tick: 0.0001
Decimals: 4
Size:
Color:
In this case, Wealth-Lab performs tick adjustment on a futures symbol, reducing the price of a sell stop order to the next lower tick increment.
Size:
Color:
Very good, but what I have to do to make the Exit Price right? Add 1 tick? I have Bars.Close[bar] and it is in MetaStock exactly 1.9781. I move this price (even through Double type conversion) to Stop and got exit on 1.9780.
Size:
Color:
Metastock prices can't be
exact numbers because MS also uses floating point representation to store price values. WL5's adapter uses the
MetaLib component for the MS interface, and the numbers are read directly as doubles without transformation.
Unless there's an app that uses the Currency type for prices, there is rarely exactness in floating point number representation. That said, Wealth-Lab should be able to recognize and work correctly with futures (and Fx) tick boundaries, but it has proven to be a challenge to make it perfect for all cases.
Size:
Color: