[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Avoid reentering



PureBytes Links

Trading Reference Links

I need a little help in coding.

I have a strategy working this way:

If the short moving average is above the long one I buy the market, the
opposite for selling.
If I want to use a trailing stop or profit taking and I exit from the
market, if the condition is still true, I immediatly re-enter in the same
position that I just closed.

Is there a way to avoid this problem and if I'm stopped either in profit or
loss and the condition is still the same I do not enter in the same position
again ?

Thanks to all

Max


"Nota di riservatezza: Il presente messaggio, corredato dei relativi
allegati contiene informazioni da considerarsi strettamente riservate, ed è
destinato esclusivamente al destinatario sopra indicato, il quale è l'unico
autorizzato ad usarlo, copiarlo e, sotto la propria responsabilità,
diffonderlo. Chiunque ricevesse questo messaggio per errore o comunque lo
leggesse senza esserne legittimato è avvertito che trattenerlo, copiarlo,
divulgarlo, distribuirlo a persone diverse dal destinatario è severamente
proibito, ed è pregato di rinviarlo immediatamente al mittente distruggendo
l'originale"

"Confidentiality Notice: This message, together with its annexes, contains
information to be deemed strictly confidential and is destined only to the
addressee (s) identified above who only may use, copy and, under his/their
responsibility , further disseminate it. If anyone received this message by
mistake or reads it without entitlement is forewarned that keeping, copying,
disseminating or distributing this message to persons other than the
addressee (s) is strictly forbidden and is asked to transmit it immediately
to the sender and to erase the original message received."