Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 201

 
solnce600:

Thank you very much.

Everything compiles.

But........

- opens a position on EVERY five minutes(every candle)

- The order volume does not change after the last stop

You've got some sick logic there, it seems to me. Do I have to deal with it?

Learn to look for bugs and errors on your own. What prevents the function determining closing by stop, after assigning the variable ll to the closed position, from printing() in the log and seeing what is actually happening there?

 
artmedia70:

It compiles. I think your logic is totally flawed there... I didn't look at it, of course. I only checked it for errors.

datetime is the same as int


The logic is as follows.

I've experimented with more than one algorithm when, under certain conditions, on a stretch of 13 years...

follow no more than 2 stops in a row.

And if after the first stop to refill a volume sufficient to compensate the first stop and get a small profit.

And if the first stop is followed by another stop, the same amount will be added, but with a larger volume.

Then the balance will always be up?
 
solnce600:

The logic is as follows.

I have found by experience more than one algorithm, when under certain conditions on a 13 year interval

follow no more than 2 stops in a row.

And if after the first stop to refill a volume sufficient to compensate the first stop and get a small profit.

And if the first stop is followed by another stop, then you should also fill in, but with a larger volume.

Then the balance will always be up?

The balance can fly to the stars. It's all about equity. Funds... You need to prevent their drawdown to the level of MarginCall of your brokerage company. If you do not have time, StopOut will intercept you and you will have nothing left over for beer... ;)

 
artmedia70:

The balance can fly to the stars. It's all about equity. Funds... And you have to prevent their drawdown to the level of MarginCall of your brokerage company. If you do not have time, StopOut will intercept you and you will have nothing left over for beer... ;)



If you have a good deposit and correctly calculate the volume of each position, then my idea is a rational one?
 
solnce600:
If you have a good deposit and the right volume, is there a rational basis for my idea?


This is called "averaging" or "Martingale", a lot has already been written about it, do a search.

 
Я
Integer:


It's called "averaging" or "Martingale", a lot has already been written about it, use the search engine.

I have already read about it.

The disadvantage is that if you get a lot of stops in a row, then no deposit will be enough.

What if there are only 2-3 stops in a row?

 
solnce600:
Я

I already read about it.

Its disadvantage is that if there are many stops in a row - then no deposit is enough.

And if there are only 2-3 stops in a row?



If 2-3 then a deposit is enough, but that doesn't happen.
 
solnce600:

I need that after the order is closed on a stop the following order opens with the volume equal to volume which was in the LAST closed on a stop

order multiplied by 2

If the LAST order was closed for any other reason (not a stop loss), the position volume should be 0.1

The logic needs to be fully corrected.
 
Integer:

If 2-3 then the deposit is enough, but this does not happen.

I myself picked up a few different conditions, when from 2000 to 2013 different pairs showed no more than 2-3 stops in a row (while I checked 2-3 pairs).

It's true that trades were not made every day.

 
Vinin:

Logic needs to be fully corrected.
Did you finish the movie?