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

 

I cannot write a function like this.

- If a SELL order is at a loss of -1000 pips. then we open the same SELL order at 1000 points from the first one. If another -1000p, we open another SELL order, etc.

 
Top2n:

I cannot write a function like this.

- If a SELL order is at a loss of -1000 pips. then we open the same SELL order at 1000 points from the first one. If another -1000p, we open another SELL order, etc.


What is the problem here? You select the necessary OrderSelect-order , for example, on the ticket, compare the profit on it with the OrderProfit-order, and then send a request to open one more OrderSend.
 
Top2n:

I cannot write a function like this.

- If a SELL order is at a loss of -1000 pips. then we open the same SELL order at 1000 points from the first one. If another -1000p, we open another SELL order, etc.


According to this condition, the second order must be opened at the current price which is approximately 1000 points away from the opening price of the first order, so there is nothing difficult - a simple order to open a new position.
 
Gentlemen, can anyone tell me where to find a better quality archive of quotes.
 
Top2n:
Gentlemen, can anyone tell me where to find a better quality archive of quotes.

We download Tickstory and use it to download ticks from Dukascopia, then we can export them to MT4, but it is only temporary, the terminal will overwrite them with its own files. That is, it is only for the tester, so the simulation quality is 99.9%.
 
evillive:

You download Tickstory and use it to download ticks from Dukascopy, then you can export them to MT4, but this is only temporary, the terminal will overwrite them with its own files. That is, it is only for the tester, so that the simulation quality is 99.9%.

Yes, the topic, thank you very much!)
 

Can't figure out what's wrong with WindowTimeOnDropped(). No values when resetting to chart( all the time =0). Wrote a little code to check it.


//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- input parameters

double xBuffer[];
int init()
  {
   string short_name;
//---- indicator line
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,xBuffer);
//---- name for DataWindow and indicator subwindow label
   short_name="Mouse";
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);
//----
   return(0);
  }

int start()
  {
  datetime Mouse=WindowTimeOnDropped();
  Alert(" Mouse= ",Mouse);
  xBuffer[0]=Mouse;
  return(0);
  }
 
Colleagues, advise how to ignore event onChartEvent(...) in EA?

The problem is that if you change the timeframe when EA is running, the EA will reinitialise and reopen the trades. In turn, trades that have been opened before remain "unattended".

How to struggle? I have to redraw the chart by some miracle, but it needs a previously initialized EA.

 
intrade:
Colleagues, advise how to ignore event onChartEvent(...) in EA?

The problem is that if you change the timeframe when EA is running, the EA will reinitialise and reopen the trades. In turn, trades that have been opened before remain "unattended".

How to struggle? I have to redraw the chart by some miracle, but it needs a previously initialized EA.


To prescribe exact unambiguous opening conditions!
 
The problem seems to be that when you change the timeframe, the Expert Advisor is pre-initialised, which leads to a lot of empty variables. And if they are empty, it means that there are supposedly no trades and we have to open new ones.
Reason: