Can you please change the member types of struct TRADE from float to double? The precision loss is a problem.
Code:
typedef struct TRADE
{
float fEntryPrice; // buy price, or premium without multiplicator
float fExitPrice; // sell price per unit, without spread
float fResult; // current profit of the trade
float fEntryLimit; // buy entry limit
float fProfitLimit; // profit limit price
// ...
} TRADE;
Here is an actual example where the conversion to float and back causes an issue. It became apparent when I tried to abuse a double to transfer a pointer to a TMF.
Code:
int callback(double v)
{
printf("ncallback v: %f", v); // v = 134550672.0
return 0;
}
void run()
{
if (Bar == StartBar)
{
enterLong(callback, 134550669.0);
}
}