TMF return value 4+16 - Pending trade never Enters

Posted By: DdlV

TMF return value 4+16 - Pending trade never Enters - 04/18/14 23:20

Hi jcl. I did enterLong(tmf) to create a Pending trade, and exited the tmf with return 20 to not call it again until the Entry condition was met, and to not enter automatically figuring this would allow the tmf to do any last-minute checks before entering. However, the tmf was never called again. The 4 appears to have prevented the call of the tmf when the Entry condition was met. I changed the tmf to return 16 and it was then called when the Entry condition was met. Are 4 & 16 incompatible for Pending trades? Or is there some other way the Entry should have been accomplished?

Thanks.
Posted By: Spirit

Re: TMF return value 4+16 - Pending trade never Enters - 04/20/14 08:59

Hmmm 4 means "do not enter" and 16 means "only call TMF when entering", so 4+16 probably means "only call TMF when hell freezes over"?
Posted By: DdlV

Re: TMF return value 4+16 - Pending trade never Enters - 04/20/14 13:12

Spirit, thanks for the quick response on Easter Sunday. Although when you have the time I'd appreciate something a bit more accurate, detailed, and useful in addressing the question.

Thanks.
Posted By: jcl

Re: TMF return value 4+16 - Pending trade never Enters - 04/21/14 07:51

I'm not sure what you want to achieve, but for calling a TMF when the entry condition is met, the right return value is 16, not 20. You can then decide in the TMF if you really want to enter or not.
Posted By: DdlV

Re: TMF return value 4+16 - Pending trade never Enters - 04/21/14 12:24

Thanks jcl. But this leaves me a bit confused as to the purpose of return value 4 - is it essentially to turn the TMF off? This seems inconsistent with the statement about return values 1 and 2 - how can they be set if the TMF is never called again?

And if 4 turns the TMF off, then how is the trade to ever be entered or exited?

The manual's 28 example is similar to what I tried (without the 8 to restrict to calling only per Bar), and seems to imply that 4 does not prevent calls as I experienced...

Perhaps an example showing the use of 4 would be useful...

Thanks.
Posted By: jcl

Re: TMF return value 4+16 - Pending trade never Enters - 04/21/14 12:49

You can find the description of all return values in the manual.

http://manual.zorro-trader.com/trade.htm

4 is for complex entry or exit conditions that are calculated in the TMF.
Posted By: DdlV

Re: TMF return value 4+16 - Pending trade never Enters - 04/21/14 12:52

I've lost count of how many times I've read this part of the manual. Could you provide a simple script showing the use of 4?

Thanks.
Posted By: jcl

Re: TMF return value 4+16 - Pending trade never Enters - 04/21/14 12:57

An example where you return 4 would be a complex exit, such as a chandelier exit. But I have no script example for this - we have not used this yet in our systems. Maybe a user can give you an example?
Posted By: DdlV

Re: TMF return value 4+16 - Pending trade never Enters - 04/21/14 13:22

Thanks jcl.
© 2024 lite-C Forums