BcLib (and many others) update... discoveries, bugs and mistakes
Last week our fellow TradeLover from the forum (who is also a contestant in MetaQuotes Automated Trading Championship 2007 - let's give him an for that) made a shocking and very disturbing discovery: a tick is not quite a pip in forex (we even argued for that, but he was right - never take anything for granted)
Running a simple script like this:
int start()
{ Print("tick size= ",MarketInfo(Symbol(),MODE_TICKSIZE),
" - tick value= ",MarketInfo(Symbol(),MODE_TICKVALUE));
return(0);
}
what he got after some hours was this:
22:40:03 ticksize GBPCHF,M1: tick size= 0.0001 - tick value= 8.53
22:40:13 ticksize GBPCHF,M1: tick size= 0.0001 - tick value= 8.53
22:40:20 ticksize GBPCHF,M1: tick size= 0.0001 - tick value= 8.53
22:40:24 ticksize GBPCHF,M1: tick size= 0.0001 - tick value= 8.53
22:40:27 ticksize GBPCHF,M1: tick size= 0.0001 - tick value= 8.53
22:40:30 ticksize GBPCHF,M1: tick size= 0.0001 - tick value= 8.53
22:40:31 ticksize GBPCHF,M1: tick size= 0.0002 - tick value= 17.07
22:40:32 ticksize GBPCHF,M1: tick size= 0.0001 - tick value= 8.53
22:40:46 ticksize GBPCHF,M1: tick size= 0.0001 - tick value= 8.53
Now what if that tick value is caught in a hedge calculus that calculates lotsizing or results for months ahead ?
In order to settle this issue once and for all, I made the RealTickValue() function as follows:
double RealTickValue(string contract)
{
double res;
res= MarketInfo(contract,MODE_TICKVALUE) / (MarketInfo(contract,MODE_TICKSIZE)/MarketInfo(contract,MODE_POINT));
return(res);
}
The function now works as a proxy for MODE_TICKVALUE inquiries. Now both BcLib and BcArb call that first when dealing with MODE_TICKVALUE.
Found surprise bugs in ReliableOrderSend and ReliableOrderClose. Don't know how they got there, as they seem to work well.
Also corrected past scripts that use MODE_TICKVALUE. Discovered also mistakes in updated SwapFinder, that's why I corrected and updated again, along with SwapButterfly.
Inserted also a mechanism for calculating futures using London InterBank rates. It doesn't seem to be too much of use, as indicators are still wrong, but you can correct their parameters, so I added DiscountedFuturesLIB and DiscountedBasisLIB indicators.
Corrected bugs in Futures script. Now it's set up with a MarginUsage of 50% and a SwapFree regime set to True by default.
P.S.
I will keep you posted with my arbitrage trades working (Spot-to-Futures type A)
3 Comentarii
Comentarii Recomandate