Any idea, how I might add a trailing stop when using enterTrade?
Setting Stop and Trail before enterTrade() appears to have no effect.
Manually settting T.fStopLimit = TradeUnderlying-Stop works for a single stop.
But I can't seem to get a trailing stop to work.
Stop = 0.10*priceClose(0);
Trail = 0.20*Stop;
TRADE T; memset(&T,0,sizeof(T));
T.tEntryDate = wdate(0);
T.flags = TR_OPEN|TR_LONG;
strcpy(T.Skill,Asset); // Asset
T.nID = 1000000+TradeID;
T.nLots = Lots;
T.fStopLimit = priceClose(0)-Stop;
// T.fStopDiff = -1*Stop;
//T.fTrailDiff = -1*Trail;
T.fEntryPrice = priceClose(0);
TRADE* p = enterTrade(&T);
if (p) {
p->manage = (void *) assignedTMF;
}