Hi Everyone,

Do you guys know how can I add an exit strategy to this hilo             .
I would like it to exit either with hilo             invertion (already does) or with profit/loss (it doesn't work)

Thank you
Remove from Favorite Scripts Add to Favorite Scripts
I had better results eliminating the if conditions prior to entry. Assuming you want to have no pyramiding, so only 1 trade open.

try to use a boolean in the below manner excluding the if statements triggering the entry.

strategy.entry("long", when=longCondition and testPeriod())

After removing the if , then try removing the // comments prior to the exit to see if it works.

I dunno if I'm correct (I could be wrong) but i'm assuming that the profit / loss is a float that wouldn't be search if untill your if statement is fullfilled while in between the movements are not calculated while your if is false.

It fixed up a mess of 2 weeks for me ... try it ...
Resposta
Brasil
United States
United Kingdom
India
Deutschland
España
France
Italia
Polska
Россия
Türkiye
Indonesia
Malaysia
日本
한국
中国
Início Rastreador de Fundamentos Identificador de Sinais Forex Calendário econômico Como Funciona Recursos Gráficos Regras da Casa Moderadores Soluções para Corretoras & Websites Plataforma Biblioteca Gráfica de Ações Suporte Prioritário Solicitação de recurso Notícias do & Blog FAQ Ajuda & Wiki Twitter
Perfil Configurações de perfil Conta e cobrança Suporte Prioritário Ideias Publicadas Seguidores Seguindo Mensagens Privadas Conversa Deslogar