Multicurrency - multitime advisor - page 4

 
Tango_X:

it can't be...for example if the slope line is broken. - there is a breakthrough = there is a signal

first of all you need to get rid of all loops, it's written in the OnChartEvent help

 
Fast528:

First of all you need to get rid of all cycles, it is written in the OnChartEvent help, now you have a tick and then in the cycle it runs a second time

if(id>=CHARTEVENT_CUSTOM)
     {
      //--- Если было событие "тик"
      if(lparam==0x00200000)
        {
         datetime t[1];
         //--- Получаем номер символа в массиве
         int s=GetNumberSymbol(sparam);
         // --- перебираем все периоды по нашему символу   
         for(int p=0;p<NUMBER_OF_PERIODS; p++)
           {
            CopyTime(Symbols[s],Periods[p],0,1,t);
            //--- Получим значения индикатора
            if(CopyBuffer(signal_indicator_handles[s][p],0,0,1,Indicator[s][p].sell)<1 || CopyBuffer(signal_indicator_handles[s][p],1,0,1,Indicator[s][p].buy)<1)
              {
               Print("Не удалось скопировать значения ");
               return;
              }
            if(Indicator[s][p].buy[0]!=0 && Symbols[s]=="USDCHF.m" && Periods[p]==PERIOD_M1) Print(Symbols[s]," ",TimeframeToString(Periods[p])," ",Indicator[s][p].buy[0]," ",t[0]);
            if(Indicator[s][p].sell[0]!=0 && Symbols[s]=="USDCHF.m" && Periods[p]==PERIOD_M1) Print(Symbols[s]," ",TimeframeToString(Periods[p])," ",Indicator[s][p].sell[0]," ",t[0]);
           }
        }
     }

Are you referring to a dedicated loop? If so, that's correct... on every tick I look through all the periods for a signal

 
Tango_X:

Do you mean a dedicated loop? If so, that's correct... on every tick I look through all periods for a signal

This OnChartEvent is dark forest, I forgot it like a bad dream, Anatoly Kazarsky from 648 also fought with it) there are long topics, multisymbol + multitimesframe, I think the chart will stand up if there is a strong movement, unlike OnTick this thing saves the queue

 
Tango_X:

I did it that way ... I did one symbol and one period - that's it!

Forum on trading, automated trading systems & strategy tester

Multicurrency - Multitime Expert Advisor

Vladimir Karputov, 2018.09.12 13:45

Start simple: current timeframe and given, current symbol and given. That is, two timeframes and two symbols - a total of four indicators. Take any indicator.


Plus I have added: noOnChartEvent. In other words, in one file of the Expert Advisor, it is as compact as possible. The minimum of code.

 
Vladimir Karputov:

plus added: noOnChartEvent. That is, as compact as possible in a single EA file. A minimum of code.

Vladimir, I don't understand anything here, can you explain?

 
Tango_X:

Vladimir, I don't understand anything here, can you explain?

Here we are: we are working on EURUSD, H1. Second symbol USDJPY, second timeframe H4.

We create four handles (example for Moving Average): MA EURUSD H1, MA EURUSD H4, MA USDJPY H1 and MA USDJPY H4.

In OnTick() we interrogate four indicators.

 
Vladimir Karputov:

Given: working on EURUSD, H1. Second symbol USDJPY, second time frame H4.

Create four handles (example for Moving Average): MA EURUSD H1, MA EURUSD H4, MA USDJPY H1 and MA USDJPY H4.

In OnTick() we interrogate four indicators.

This algorithm will analyze, say, several currency pairs, but only on tick events of the chart, on which the EA will be applied. I.e., for example, we threw the EA on EURUSD and wait for the tick.... and at the same time, USDJPY has already passed 5 ticks - how it is here? This is fundamentally wrong!

 
Tango_X:

With such an algorithm we will analyse several currency pairs, but only on the event of a tick in the chart to which the EA will be attached. I.e., for example, we threw our EA on EURUSD and wait for the tick.... and at the same time USDJPY has already passed 5 ticks - how? ***

Yes, that's right. In fact it's a very simple variant without events, agents and the like.


You have to implement such a scheme first.

 
Vladimir Karputov:

Yes, that's exactly right. It's actually a very simple option without events, agents and the like.


You have to implement such a scheme first.

Well, it's easy! I do not need such an algorithm and I know how to implement it - I have a different situation... That's why I'm asking for help. What you offer me is primitive, easy and useless in this case).

 
Tango_X:

Well, it's easy, isn't it? This algorithm doesn't suit me and I know how to implement it... I have a different situation... That is why I am asking for help. What you offer me is primitive, easy and useless in this case)

Ah, so it is :)

Then I politely take my leave.

Reason: