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

 
ALXIMIKS:

Question: What is the last closed order in the order history when OrderSelect is selected?

1) Zero "0";

2) The last "OrderHystoryTotal -1 "

3) Random

4) Depends on when the order was opened (which is closer to 1 or 2 then?)

Are you absolutely sure about this, that this is how the orders are located in the list? What if the history is reshuffled at one unpleasant moment and the orders in it start to be located differently? The most reliable way is to find the extreme one by time, not by a hypothetical assumption in your head...

It's one thing to make a toy for a tester, but it's another thing to work in the real world. Let him get used to taking into account all the possible pitfalls that may "suddenly" happen...

 
ALXIMIKS:

Question: What is the last closed order in the order history when OrderSelect is selected?


https://www.mql5.com/ru/forum/131859/page4#434227
 
solnce600:

I would be very grateful if you could explain "on your fingers" in relation to my example.

Where my logic is faulty. I don't understand what it's about.

Thank you.



if(your_first_condition)

{

//there will be

// execute

// all

// these

// strings, only if

// your_first_ condition is true

}

// this line will be executed in any case



if(your_second_condition)

// this string will only be executed if your_second_condition is true

// this string will execute in any case even if your_first_precondition returns false

// this string will hold true even if your_second_condition returns false.


 
Vinin:

To fix any part, you have to write a ToR, are you ready for that?
Not yet.
 
artmedia70:

Are you absolutely sure that this is how the orders are placed in the list? What if, at some unpleasant moment, the history is reshuffled and the warrants start to be arranged differently in it? The most reliable way is to find the last one by time, not by a hypothetical guess in your head...

It's one thing to make a toy for a tester, but it's quite another thing to work in the real world. Let him get used to taking into account all possible things that may "suddenly" happen...


This question is not quite right ((

It does not make much sense to go through all of the closed orders every time before opening.

What can we do? Well, the data on the last closed order should be saved in a file and updated when the total number of closed orders changes. (This already represents some sort of economy).

What if there are 1000 or 5000 orders in the history? Is the order history ever cleaned up, or is it always cleaned out? If so, by whom?

I asked what part of OrderSelect will contain the last closed orders, since it increases the time required for the search when the history increases,

I would just like to narrow down the search.

 
digits:

Good afternoon.

My strategy takes into account the spread, the spread is defined by a function:

But because the spread is constant in the strategy tester, I need a random spread emulator. I want to emulate the changes of spread in the tester in the range of 2 to 3 points (4 digits) in 80% of cases and more than 3 points in 20% of cases. Maybe you have ideas how to implement this, or links where this idea was solved.


Probably no one is interested in this topic, but for the sake of your opinion I will post a version where the spread is only 2 or 3 pips.

double Spread_(){
   int compare = 0;
   int MaRand = 0;
   double sp = 0.0;
   double spread = 0.0;
     if (IsTesting() == TRUE){
         MathSrand(OrderTicket() + TimeLocal() / Bid);
         MaRand = MathRand();
         MaRand = MaRand % 2;
         if(MaRand == compare){
         sp = 2.0;
         }else{
         sp = 3.0;
       }
       spread = sp;
    }else{
       RefreshRates();
       spread = MathRound((Ask - Bid) / Point);
     }
   return(spread);
}  

 
digits:

Probably no one is interested in this topic, but for the sake of your opinion I will post a version where the spread is only 2 or 3 points.


You should change your avatar. Make it something neutral. Links are forbidden.
 

Hi Folks, can anyone give a clear answer!!! Tech-analysis+martin

I searched all over the net and did not find a clear answer if anyone has any info, please let me know.

 
artmedia70:

if(your_first_condition)

{

// here it will be

// execute

// all

// these

// strings, only if

// your_first_ condition is true

}

// this line will be executed in any case



if(your_second_condition)

// this string will only be executed if your_second_condition is true

// this string will execute in any case even if your_first_precondition returns false

// this string will execute in any case even if your_second_condition returns false



If I understand what my first and second conditions are and the string that always executes - I will come close to solving this mystery.

THIS IS THE FIRST CONDITION

if ((ot==0))
&&(Bid==Price)
&&(Open[1]-Close[1]>100*Point&&Open[1]-Close[1]<120*Point)
&&(High[1]-Open[1]>40*Point&&High[1]-Open[1]<60*Point)
&&(Close[1]-Low[1]>40*Point&&Close[1]-Low[1]<60*Point))

THIS IS THE SECOND CONDITION

if (isCloseLastPosByStop(Symbol(), OP_BUY, Magic, Lot))

THIS IS A STRING THAT WILL ALWAYS BE EXECUTED

return(0);

Right?

 
FEAR:

Hi Folks, can anyone give a clear answer!!! Tech-analysis+martin

I've googled all over the internet. I can't find a clear answer if anyone has any information.



Read the story of probably the biggest martingale... "It wasn't the point that ruined me, it was the ace by eleven".

In 1993, Nick Leeson was appointed general manager of the Singapore branch of Barings Bank's futures division. In this capacity he was able to hide his secret trading operations for over a year as he managed both the back office and the trading. Barings Bank's senior managers were mostly experienced in trading firms and knew little about stock trading. The large profits should have led management to believe that there was significant risk involved, but they continued to believe that Leeson dealt equally with the Singapore Foreign Exchange (Simex) and the Osaka exchange, and therefore profited from low-risk operations.

As losses grew, Lison increased his bets. However, after the Nikkei Index collapsed due to the earthquake in Japan, losses rose catastrophically and the deficit was over $1 billion. This proved to be too much for the bank; in March 1995 it was bought by Dutch bank ING for just one pound.


Reason: