I've been trying to figure out how to reverse a position directly out of a TMF, in order to have immediate execution at the Tick instead of having to wait for the next bar(s).

Here is my TMF:

int TMFLong()
{
var Thresh = Trail*3;
bool Cond_LongStop = price(0)<=priceClose(1);
if(TradeResult>Trail) TrailLock = 80;

if(Cond_LongStop and TradeResult>Thresh){
exitLong();
return enterShort(0);
}
return 0;
}

Instead of the combination

exitLong();
return enterShort(0);

I tried directly

reverseShort(0)

but it doesnt seem to open a Long position.

What am I doing wrong?

Attached Files
Capture.PNG (273 downloads)
This is what I get - but I want a continous flow of Long and Short orders
Last edited by UPL; 12/20/13 13:15.