You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Good morning!
A word of advice to a very novice))). The question is as follows:
Let's assume a position was opened by a price jump and an ascending MA (it is set in the code), but almost immediately the chart changed, that is, the MA started going down (as well as the entire chart of course)) ). I have to write a function that will close the position at this point, but I have not reached stop loss or limit and reopen the position with the new data. And it all has to be checked each time. I hope the description is clear:)))
Please advise, who knows)
In the attachment is the situation of what I would like to avoid or at least make less.
MA changes direction during opening and closing a position several times.
forward666: Хочется добиться того,чтоб при первом же изменении МА в обратную сторону происходило закрытие минусовой позиции и открытие новой позиции по верным условиям
1. Compare the previous and current MA value.
2. If the current MA value has changed to the "wrong" side, check the position for "minus".
If the position turned out to be negative, check the conditions for opening an opposite position. 3:
3а. If there are no conditions to open the opposite position - send an order to close the initial negative position;
3б. If there are conditions to open the opposite position - send an order to reverse the position.
1. Compare the previous and current MA value.
2. If the current MA value has changed to the "wrong" side, check the position for "minus".
If the position turned out to be negative, check the conditions for opening an opposite position. 3:
3а. If there are no conditions to open the opposite position - send an order to close the initial negative position;
3б. If there are conditions to open the opposite position - send an order to reverse the position.
Good luck in learning the language, I doubt someone will write everything for you. At least share your code, tell us where there are errors, we will help you.
It is clear that no one will write for me!) Maybe someone has a link to similar codes, at least to see what and how!
If I had this part of the code at least somehow described, then share it.
It is clear that no one will write for me!) Maybe someone has a link to similar codes, at least to see what and how!
If I had this part of the code at least somehow described, I would share it. but I don't even know where to start(
Let's say the deposit is 20 thousand rubles.
For each transaction, 2% of the stop loss - i.e. 400 rubles.
Staples is set at 150 points. So 1 point is no more than 2.6 roubles.
So, in order to cover 1.5% monthly inflation (300r) and make 5% monthly increase of deposit - you should make more than 6.5% monthly - i.e. 1300r or 1300/2.6 = 500 points minimum. Overall, the minimum is 78% per annum.
What is your minimum number of points in profit every month?
I am reading the articles and studying the manual.)
I have one more question: when I run a robot, it opens a position that obviously does not reflect the reality of the chart, so it goes into deep red. How do I make this position not open right away when I run the robot? Where in the code should I add something?
I am reading the articles and studying the manual.)
I have one more question: when I run a robot, it opens a position that obviously does not reflect the reality of the chart, so it goes into deep red. How do I make this position not open right away when I run the robot? Where in the code should I add something?