[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 288
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 afternoon who can help solve a problem, maybe I'm doing something wrong,
I have a Klima block that returns the closing flag of the last position at takei. and the same for the stop,
but here's how I use it.
and at first everything goes as planned and at lot 4 opens the one I need and this one
I can't figure out what it's for.
for clarity
I can't figure out what it's for
That's right,
The first check (total==1) takes place when the order is still 1. Inside the block, you find the last closed Sell -> open, the last closed Buy -> open again. That makes 3 orders.
Yeah, that's right,
The first check (total==1) takes place when the order is still 1. Inside the block you find the last closed sell -> open, the last closed buy -> open again. This already results in 3 orders.
Yes, but how to make it was only 2 orders, so it does not open an order under number 6,
The easiest way is to check for the presence of an open order of Buy or Sell type. Take this (variables BuyOrders, SellOrders, TotalOrders are global variables in the program; they must be declared in the start() function as int BuyOrders, SellOrders, TotalOrders;) :
There are plenty of options, the easiest is to check for an open Buy or Sell order. Take this one:
I don't understand how to use it please help me.
I don't understand how to use it, so help me if you can.
Are you sure it opens buy in three cases and sell in one? It's not symmetrical...I will, but I still don't understand the logic of your code:
Are you sure that in three cases you open a Sell position and in one a Buy position? It's not symmetrical...I'll help you, but I don't understand the logic of your code yet:
I want it to open when there is no position in the market and if one of the values is correct then open 1 order and wait for the position to close then i tried to do it that way but nothing works
I want it to open only if there is no position in the market and if one of the chosen values is correct then open 1 order and wait for the position to close.
So it turns out you may have 2 buy orders and no sell?
Figar0:
Т.е. получается что возможна ситуация когда у вас будет 2 ордера на покупку и не одного на продаж
No vice versa, the positions should be just 2 including sell without stops and keepers, the statement shows how it works. right, but an extra position opens under number 6
Well, then everything will be much more complicated. Describe in words how the algorithm should work and I will try to help you while I'm at it)
- 2 positions are possible at the same time;
- first open 2 positions: buy and sell;
- if the long position is closed by a stop loss -> open a short position with tripled SL and TP, we get two sell positions, one with a regular SL and TP, and one with tripled TP;
Next?