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

 
001:

I'm trying to get an answer for myself. Is it possible to get the code to recognize clearly the extrema shown by the arrows. Maybe somebody already has such an answer. I think fractals (at least the ones I've seen) are not what I need.

Zigzag can find them. There are a lot of different zigzags and even more setups. So, it is possible to find them.
 
001:

I'm trying to get an answer for myself. Is it possible to get the code to recognize clearly the extremes shown by the arrows. Maybe somebody already has such an answer. I think fractals (at least the ones I've seen) are not what I need.


Of course you can determine, just retrospectively
 

Here's part of the code. I sort out the deleted and triggered orders, and if there is an order triggered at takeprofit, then {C=0;A=1 ; Alert("C",C, "A",A);}} . That's the very thing that doesn't happen then.

Here

for ( i=OrdersHistoryTotal();i>0;i--){ OrderSelect(i-1,SELECT_BY_POS,MODE_HISTORY  ); Alert("wremjapomnim " ,wremjapomnim," OrderCloseTime ",OrderCloseTime(    ),
   "   OrderTakeProfit ",OrderTakeProfit(), " OrderClosePrice " ,OrderClosePrice() );
   if( OrderMagicNumber( )==2000 &&OrderSymbol()==Symbol()&&OrderTakeProfit( )==OrderClosePrice(        )&&wremjapomnim<OrderCloseTime( ) ||
   OrderMagicNumber( )==1000 &&OrderSymbol()==Symbol()&&OrderTakeProfit( )==OrderClosePrice(    )&&wremjapomnim<OrderCloseTime( ))
   
 {C=0;A=1 ;  Alert("C",C,"A",A);}} 
 

In Russian, if the magic number is 2000 AND if it's that currency pair AND if the close price equals takeprofit OR

if a magik equals 1000 AND if it is that currency pair AND if the close price equals the take profit

It seems to be nothing very complicated, but it may not work! I checked it by details and placed it separately in the if step, for example OrderTakeProfit( )==OrderClosePrice( ).

So it seems to work individually, but together it doesn't want to!!!

 
dkfl.zrjdktdbx:

Here is part of the code. if the closing price is equal to the take profit

To close an order with a Take Profit equal to the price is rather problematic.
 
dkfl.zrjdktdbx:

Here's part of the code. I sort out the deleted and triggered orders, and if there is an order triggered at takeprofit, then {C=0;A=1 ; Alert("C",C, "A",A);}} . That's the very thing that doesn't happen then.

Here

In Russian, if the magic number is 2000 AND if it's that currency pair AND if the close price equals takeprofit OR

if a magik equals 1000 AND if it is that currency pair AND if the close price equals the take profit

It seems to be nothing abstruse, but it may not work! I checked it by details and placed it separately in the if step, for example OrderTakeProfit( )==OrderClosePrice( ).

It seems to be that everything works separately, but it won't work together!


Spread out all the brackets and read the reference

MQL4 Reference - Basics - Operations & Expressions- Precedence rules

 
forexnew:

Can you tell me how to calculate the spread that existed when the order was closed after some time? Is this even possible?

The closing price already takes into account the spread. How can it be calculated post facto?

If you do not have a hand in this, it is impossible to know the spread at any point of time other than the current time! When you open an order, you can record the value of the spread, for example, in the comment to the order. You can also monitor the spread, by writing its average value to the file or indicator buffer, for example, every minute. It depends on what purpose you are pursuing.
 
dkfl.zrjdktdbx:

Here's part of the code. I sort out the deleted and triggered orders, and if there is an order triggered at takeprofit, then {C=0;A=1 ; Alert("C",C, "A",A);}} . That's the very thing that doesn't happen then.

Here

In Russian, if the magic number is 2000 AND if it's that currency pair AND if the close price equals takeprofit OR

if a magik equals 1000 AND if it is that currency pair AND if the close price equals the take profit

It seems to be nothing very complicated, but it may not work! I checked it by details and placed it separately in the if step, for exampleOrderTakeProfit( )==OrderClosePrice( ).

So it seems to work individually, but together it doesn't want to!!!


Try to connect the "standard" Kim I.V. function of determining the closing of the last order on the takeaway...
 
Zhunko:
Zigzag can find them. There are many different zigzags and even more settings. So it's possible to find one.

Thank you!
 
MaxZ:
If you do not put your hand to it, then it is impossible to know the spread at any point in time, other than the current moment!!! When you open an order, you can record the value of spread, for example, in the comment to the order. You can also monitor the spread, by writing its average value to the file or indicator buffer, for example, every minute. It depends on what goal you are pursuing.

In essence, to control the broker. But at the time of closing the transaction. I get the idea. The deal is triggered, it appears in the deal history, at which point you can capture the spread and record it in the file. Thank you!

 
Zhunko:
Zigzag can find them. There are many different zigzags and even more settings. So it's possible to find one.

Can you tell me which one?