Set entry limit with a negative price

Posted By: Sphin

Set entry limit with a negative price - 04/29/18 11:36

Quote:
A positive price or distance constitutes an entry stop, a negative price or distance an entry limit.

Does Zorro really internally calculate further on with the negative value if a limit is set this way?

from TMF:

Code:
if(!TradeIsOpen) {																					// cancel trade immediately if price is over/under limit 
	print(TO_LOG,"nTradePriceOpen: %.5f, Entry: %.5f", TradePriceOpen, Entry);										
	if(TradeIsLong && TradePriceOpen > Entry) 
		return 1;
	[...]
}



from log:

Code:
(EURUSD::L) Long 1@1.21739 Entry limit
TradePriceOpen: 1.21735, Entry: -1.21739
(EURUSD::L) Entry 1.2174 removed (TMF)


This is only true if comparing 1.21735 with -1.21739 but the sense of this operation is of course comparing 1.21735 with 1.21739 and enter the trade.
Posted By: jcl

Re: Set entry limit with a negative price - 05/03/18 11:22

No, all parameters like Stop, Entry, etc. are internally converted to positive price limits that you can read in the TMF.
© 2024 lite-C Forums