[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 731

 
artmedia70:

Is he waiting for them to fall out of the sky? :)) If he closes one in profit, then he waits for losses!!!!????!!!! If he starts trading after them, where (???) they will come from.) So he closed a profitable one before them and stopped the trade waiting for unprofitable ones...

Completely baffling logic, or your interpretation...


Absolutely right :) he has to wait for 2 unprofitable ones to open then :) The theory is based on statistics and probability theory.
 
artmedia70:

Is he waiting for them to fall out of the sky? :)) If he closes one in profit, then he waits for losses!!!!????!!!! If he starts trading after them, where (???) they will come from.) So he closed a profitable one before them and stopped the trade waiting for unprofitable ones...

Completely baffling logic, or your interpretation of it...


I agree, it doesn't make any sense, .... who has to trade where the trades come from,......... why first emulate 2 losing trades before and then trade without relying on those 2 losing trades,.....
 

We are talking about virtual trades, apparently.

Objects to throw on the chart, keep an eye on them. Probably.

 
cyclik33:

Absolutely right :) he has to wait for 2 loss-making ones to open :) The theory is based on statistics and probability theory.

How can he wait for two losing trades if the last one he closed was profitable?
 
Abzasc:

We are talking about virtual trades, apparently.

Objects to throw on the chart, keep an eye on them. Probably.


I would understand if the Expert Advisor would make two losing trades by itself. The Expert Advisor would model them in its own way and start looking for entry based on the models, ... then there is some logic, but otherwise ???????
 

Good evening, could you please advise how to set an alert in the indicator, I tried everything, then at every tick it signals, then it does not signal at all

//+------------------------------------------------------------------+
//| i-3CCI-h.mq4 |
//| johnfantom & KimIV |
//| http://www.kimiv.ru |
//| |
//| 02.01.2006 CCI с 3-х ТФ в одном флаконе. |
//+------------------------------------------------------------------+
#property copyright "johnfantom & KimIV"
#property link "http://www.kimiv.ru"

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
#property indicator_maximum 1.4
#property indicator_level1 0
#property indicator_minimum -1.2

//------- Внешние параметры индикатора -------------------------------
extern int CCI_Period_0 = 14; // Период CCI для текущего ТФ
extern int Level_0 = 100; // Уровень CCI для текущего ТФ
extern int TF_1 = 60; // Количество минут первого ТФ
extern int CCI_Period_1 = 14; // Период CCI для первого ТФ
extern int Level_1 = 100; // Уровень CCI для первого ТФ
extern int TF_2 = 240; // Количество минут второго ТФ
extern int CCI_Period_2 = 14; // Период CCI для второго ТФ
extern int Level_2 = 100; // Уровень CCI для второго ТФ
extern int NumberOfBars = 10000; // Количество баров обсчёта (0-все)
extern bool EmailON = TRUE;
extern bool SoundON = TRUE;

//------- Буферы индикатора ------------------------------------------
double buf0[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
void init() {
IndicatorDigits(1);

SetIndexBuffer(0, buf0);
SetIndexLabel (0, "i-3CCI-h");
SetIndexStyle (0, DRAW_HISTOGRAM, STYLE_SOLID, 2);
SetIndexEmptyValue(0, 0);
}

//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
void deinit() {
Comment("");
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
void start() {
double cci0, cci1, cci2;
double alertTime;
int nb1, nb2;
int LoopBegin, sh;

if (NumberOfBars==0) LoopBegin=Bars-1;
else LoopBegin=NumberOfBars-1;
LoopBegin=MathMin(Bars-1, LoopBegin);

for (sh=LoopBegin; sh>=0; sh--) {
nb1=iBarShift(NULL, TF_1, Time[sh], False);
nb2=iBarShift(NULL, TF_2, Time[sh], False);

cci0=iCCI(NULL, 0, CCI_Period_0, PRICE_CLOSE, sh);
cci1=iCCI(NULL, TF_1, CCI_Period_1, PRICE_CLOSE, nb1);
cci2=iCCI(NULL, TF_2, CCI_Period_2, PRICE_CLOSE, nb2);

if (cci0>Level_0 && cci1>Level_1 && cci2>Level_2) { buf0[sh]=1;
if (buf0[sh]!=1 && alertTime != Time[0]) { alertTime = Time[0];
if (EmailON != TRUE) SendMail ("Signal", "UP");
if (SoundON != TRUE) Alert ("Signal UP");}
}
if (cci0<-Level_0 && cci1<-Level_1 && cci2<-Level_2) { buf0[sh]=-1;
if (buf0[sh]!=-1 && alertTime != Time[0]) { alertTime = Time[0];
if (EmailON != TRUE) SendMail ("Signal", "UP");
if (SoundON != TRUE) Alert ("Signal UP");}
}
}

}
//+------------------------------------------------------------------+

 
Infinity:

I would understand if the Expert Advisor would make two losing trades by itself, the Expert Advisor would model them in its own way and start looking for entry based on the models, ... then there is some logic, but as for ???????.

But this way, you hang an object, memorise the price and keep track of the difference.

The price is more of a convenience, it's easier to use the date and time price.

 
Abzasc:

But this way, you hang an object, memorise the price and keep track of the difference.

It's more of a convenience, it's easier to use the date and time price.


Well, I know this method, by the way, it is described here on the forum in articles like, and the logic is still unclear, ..... If you have a good reason, then you should model trades hoping they will be profitable and use this modeling to search for the same situation. If it is based on "as the author said" statistics and probability, it is much easier to open trades by probability or else.
 

Let me explain it with an example.

Let's assume the following strategy: the EA opens a trade at the beginning of each day. if the previous day was bullish, the trade is buy. if it was bearish, the trade is sell.

we need :

1) the EA starts working.

2) If the previous two days were bearish, we opened (ostensibly) for a sell trade, but then (ostensibly) we went for a sell or buy.

If we did not have 2 virtual Losses, then EA will wait until they appear and then it opens a position.

The strategy should naturally be different, but the meaning is the following.

 

The emulation of losing trades is clear. The Expert Advisor catches a trading signal, e.g. into a long position. It remembers the imaginary order opening point and its stop orders. Then it monitors the ticks. If the price touches the stop of the virtual order, the trade is recorded as a loss trade. If it touches a take order, the trade will be shown as profitable. The only thing we need to find out by which trading system the points of imaginary order setting should be tracked.

cyclik33, I surely will not do it - I have some work to do now. I have asked questions and made this comment just to clarify things. I've already written it to clarify the problem.

Good luck in finding an altruist - your idea is quite feasible in program code.