[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 2

 
yosuf:
I recently read an idea on this forum that if you open 2 differently directed orders at the same time with the same SL, then after one of them closes you can try to make a profit. Has anybody checked this idea or not? Maybe there is a similar EA?

It's a loss if you go head-on...


 
Can you please tell me how to identify and delete one of the two pending orders? There are 2 orders, when the price comes close to one of them by 5 pips, the second one should be deleted. How can I do it?
 
Andreev:
Could you please tell me how to determine and delete one of two pending orders? There are 2 orders, when the price approaches one of them by 5 pips, the second one should be deleted. How do I do that?


you can mark them (with different comments or magic numbers when placing an order) and when the price approaches one of them to compare the difference(open price of one - close) or (open price of the other - close).

OrederSelect (total()-1...)

if the comment is right

{ close }

else

{OrderSelect (total()-2...)

if the comment is required

{close}

It looks like it should look something like this.

 
LazarevDenis:


you can do that (with different comments or magic numbers when placing an order) and when the price approaches one of them to compare the difference (open price of one - close) or (open price of the other - close).

OrederSelect (total()-1...)

if the comment is required

{ close }

else

{OrderSelect (total()-2...)

if the comment is required

{close}

it should look something like this


Thank you very much for the information!!! I'll give it a try :)
 
granit77:
There used to be a lot of such advisors, but now I don't even see them in the database. They are perfectly optimised, but they are a total waste. Beautiful simple solutions always carry a trap.
In general, I envy Yusufhoja. That if I started to study chemistry seriously now, how many simple but brilliant chemical ideas I would come up with with my virgin brain!

Everything always starts from the simple and gradually becomes more complicated. As it turns out simple is inefficient and that's why you have to complicate in order to survive. Such is the nature of things. Evolution. )) Traps bring pain and force you to find more efficient solutions. In a trading strategy there must be many blocks (in my TS) and each block performs its task. So far I have managed to find optimal variant for large TFs (daily charts). I do not have enough computer power and programming experience for intraday trading. I have been doing it from morning till night every day. So I continue to learn and work, and I advise others to do the same. This is good advice, the main thing is not to stop and it will definitely pay off)).
 
Help my advice, the scenario is, after a steep fall EURUSD to 1.4257, started to rise to 1.4346, and opened a buy order at 1.4322 TP = 1.4362, but the rate reached 1.4346 turned and fell by about 20 points, then the price immediately jumped to 1.I reached the price at 1.4266 and went further downwards, how to avoid such moments, when the price started to fall the EA had to close the order, but got error 138, it means the price is out of date and everything, but the price was going down, so I had to close the order somehow
 
LazarevDenis:
Help my advice, the scenario is, after a steep fall EURUSD to 1.4257, started to rise to 1.4346, and the EA opened a buy trade at 1.4322 TP = 1.4362, but the rate reached 1.4346 turned and fell by about 20 points, then the price jumped to 1.I reached the price at 1.4266 and went further downwards, how to avoid such moments, when the price started to fall the EA had to close the order, but got the error 138, it means the price is out of date and everything, but the price was falling and I had to close the order somehow

Stop Loss, how else? Such moment may occur at an important news release. The brokerage companies usually answer like this: "Don't trade on the news".
 

I need to close one of the 2 pending orders. I can't figure out how to do it. Lazarev Denis has advised to mark them with magic number and has provided below method of selection. I like this idea but the OrderSelect function description does not mention anything about magic number. If "1" and "2" are magic numbers in the example below, what should be written instead of triplet??????????


OrederSelect (total()-1...)

if the comment is required

{close }

else

{OrderSelect (total()-2...)

if the comment is required

{close}

Maybe someone can suggest another way to determine and delete one of the two pending orders?

Would be grateful for help!!!!!

 
Andreev:

Can anyone suggest another way of identifying and removing one of the two pending orders?

I would be grateful for help!!!!!


About this:

for(int count = OrdersTotal()-1; count >= 0; count--)
  {  
     OrderSelect(count, SELECT_BY_POS, MODE_TRADES);
     if (OrderType() == OP_BUYSTOP && OrderMagicNumber() == 12345)
       {  
          // действия
       }
 
advise how to correctly write in an EA to determine the entry point of the two timeframes? more precisely: to describe the parameters of a candle longer and shorter timeframe.