Have found a glitch in the Close command for an EA I'm developing. If this were an old math class I'ld outline it up something like this:
-------------------------------------
Given Items:
Variable A
Variable B
Opening Formula
When A > B then open trade LONG (TradeDirection=1 ?)
When B > A then open trade SHORT (TradeDirection=-1 ?)
Closing Formula
When Trade = Long / Close if B > A
When Trade = Short / Close if A > B
-------------------------------------
Note that the Close is not the same as simply "close if..." . Since the EA is designed to open in either direction, my current attempt has it wrestling with itself when A&B change directions / Not real healthy ...
Any thoughts for a couple of lines of code would be appreciated ...
Thank you ahead of time ,
Pip Parade
-------------------------------------
Given Items:
Variable A
Variable B
Opening Formula
When A > B then open trade LONG (TradeDirection=1 ?)
When B > A then open trade SHORT (TradeDirection=-1 ?)
Closing Formula
When Trade = Long / Close if B > A
When Trade = Short / Close if A > B
-------------------------------------
Note that the Close is not the same as simply "close if..." . Since the EA is designed to open in either direction, my current attempt has it wrestling with itself when A&B change directions / Not real healthy ...
Any thoughts for a couple of lines of code would be appreciated ...
Thank you ahead of time ,
Pip Parade