PureBytes Links
Trading Reference Links
|
Barrsinceentry only contains the value of the first time you have gone long, if you go long 3 times, you cannot reference the barrsinceentry of each position. So in your example, you go long 3 times at the same time. When barssinceentry > 20 you exit position one, leaving 2 positions. However, bassinscentry does not get rest here. So if you get another position in the first order whilst you still have a position in the other 2, then barssincentry is still >20, so the exit condition is met straight away, so you immediatley exit.
You will have to keep track of the barrsincentry for each position yourself, or maybe split the code into 3 systems.
Tom.
--
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
|