Hello,
I have a TMF, here is how I define it, and the way I open the trade:
int tmf(int startBar, int endBar){
printf("\ntmf startbar endbar %d %d", startBar, endBar);
printf("\ntmf2 int int %d %d", TradeInt[0], TradeInt[1]);
return 0;
}
...
TRADE* asd = enterLong(tmf, innerImpulseStartBar, innerImpulseEndBar);
if (asd){
ThisTrade = asd;
TradeInt[0] = innerImpulseStartBar;
TradeInt[1] = innerImpulseEndBar;
}
innerImpulseStartBar and innerImpulseEndBar are both integers, there are no conversations in this case.
At the output window I see the following:
...
tmf startbar endbar -1645196208 -104
tmf2 int int 4 1
...
It seems like a memory garbage, like the startBar and endBar in the tmf is never setted up.However, if I use vars and floats like this:
int tmf(var startBar, var endBar){
printf("\ntmf startbar endbar %.5f %.5f", startBar, endBar);
printf("\ntmf2 float float %.5f %.5f", TradeVar[0], TradeVar[1]);
return 0;
}
...
TRADE* asd = enterLong(tmf, (float)innerImpulseStartBar, (float)innerImpulseEndBar);
if (asd){
ThisTrade = asd;
TradeVar[0] = (float)innerImpulseStartBar;
TradeVar[1] = (float)innerImpulseEndBar;
}
I get the following result:
tmf startbar endbar 4.00000 1.00000
tmf2 float float 4.00000 1.00000
Am I wrong, or is it a bug in the tmf input handling?