Page 1 of 1

Adjusting the exit depending on time

Posted: Tue Jan 18, 2011 11:11 am
by CyTrend
Hello was wondering if you could guide me as to how to alter the exit price depending on the time I am in a trade. I was looking a basiclly for a function that would tell me who many days i am in a trade. I can't use instrument.TradeDaysinTrade since it is historic, but I am looking for something similar so i can tell it, if you are in the trade for 3 days do the following etc.

Also was wondering if I could use the entry ordered filled script to do so?

Posted: Tue Jan 18, 2011 11:41 am
by Eventhorizon
Use instrument.unitBarsSinceEntry[n] to identify how long you have held a unit "n" if you want to count by bars, or use instrument.unitEntryDate[n] if you want to count by calendar days.