Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

close position by stop or take profit #462

Brianramirez27 started this conversation in General
Discussion options

Hello, I programmed a strategy of crossings of emas and established a sl and tp but it only opens 3 operations and does not close them, I would like to know if I should do something to close the operations by tp or sl
pregunta final

You must be logged in to vote

Replies: 3 comments 7 replies

Comment options

SL and TP orders should be executed automatically once the price level (0.2 or 4.0, for example) is hit.

You must be logged in to vote
0 replies
Comment options

I only open a trade and never close the operation in 10 years for what reason can it be
Uploading 45.JPG...

You must be logged in to vote
7 replies
Comment options

At the price only. Is there anything in the documentation suggesting otherwise?

Comment options

Not in the documentation it does not say that, only that I do not see much information on how to place the stop and the tp, since if it goes in price how could it be to know at what price there is an entry and what price should the stop go, I supposed It was in percentage since in each entry that was only if it reached that percentage it closed the position, but I see that it is not like that, then I must know at what price to place the stop and if there are a thousand operations I must know each operation at what price is the stop?

Comment options

ffff
These are the prices that I have, which would be the correct way to put a stop and a take profi

Comment options

Were you aware of and have you seen the tutorials? At least two of those show how to set sl= (...) properly ... 😄

Comment options

I already solved it, the current price has to go first and multiply it by the tp and the stop

if crossover(self.ma1, self.ma2):
self.buy(sl= price0.99,tp=price 1.01)

This comment has been hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /