Custom Symbols bars and ticks

 

Hello!

Does Terminal make custom symbol bars from imported ticks or rates should be calculated from the ticks and imported additionally? Or maybe there is some specific function to refresh/redraw/recalculate which would make terminal (re)make the bars from the ticks?

The custom symbol ticks are successfully made and added (both customticksadd and customticksreplace return the number of ticks that should be imported).

 
kypa:

Hello!

Does Terminal make custom symbol bars from imported ticks or rates should be calculated from the ticks and imported additionally? Or maybe there is some specific function to refresh/redraw/recalculate which would make terminal (re)make the bars from the ticks?

The custom symbol ticks are successfully made and added (both customticksadd and customticksreplace return the number of ticks that should be imported).

Yes, terminal adjusts bars according to ticks. Do you mean you don't see new bars after adding custom ticks?

 

Yes, no bars appeared at all. I tried to make random ticks per random periods of milliseconds so I can see the difference between random chart and real market.

Ticks appeared in Market Watch tick chart.

Is it possible I've made way too big ticks and it resulted in some error (which, of course, I didn't check so I never knew it happened)?


Not sure if I can post a link to other forum, but this is the thread where discussion is ongoing, the last pages mostly: http://forum.bg/showthread.php?5644

Seeing a random chart may be a really valuable lesson. Mateev is quite interested in randomness theories and knows a lot, besides he owned a broker a few years ago, the first Bulgarian MT4 broker.

The concept is still a mess, when it's ready I will share the code here. MathRand doesn't really provide enough randomness for such chart, that's the major problem.

Невронни мрежи и изкувствен интелект
  • kypa
  • forum.bg
Последните години доста публични проекти в таз насока, някои можели да разпознават картинки, други даже да рисуват и да сънуват. Тука да се споделя опит някой като реши да пробва нещо такова върху пазаря.
 
kypa:

Yes, no bars appeared at all. I tried to make random ticks per random periods of milliseconds so I can see the difference between random chart and real market.

Ticks appeared in Market Watch tick chart.

Can you provide a short code snippet adding ticks, which demonstrates the problem? I made some custom stuff based on real symbols, and according to my experience, ticks affect bars.

 

My ticks were random values added/divided to bid, another added to time, ask=bid and flagged ask and bid, but importing ticks from other instrument gives the same result.

//+------------------------------------------------------------------+
//|                                                          tks.mq5 |
//+------------------------------------------------------------------+

string kyp = "Kyppppppppppppppp";
int колкоминуткиданарисуваме=1000;
MqlRates muhrates[];
MqlTick muhticks[];
datetime от, до;

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+

int OnInit()
  {
   if(_Symbol!=kyp) Print("създаванье символъ: "+(string)CustomSymbolCreate(kyp,NULL));
   Print("показванье символъ: "+(string)SymbolSelect(kyp,true));

   return(INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+

void OnDeinit(const int reason)
  {
   Print("скриванье символъ: "+(string)SymbolSelect(kyp,false));
   if(reason==REASON_CHARTCLOSE || reason==REASON_REMOVE) 
   if(CustomSymbolDelete(kyp)) Print("символъ Курецъ изтрит");   
   else Print("символъ Курецъ трябва после да се изтрие ръчно от Символи/Костумъ");
  }

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+

void OnTick()
  {
//---
   
  }

//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+

void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
   if(id==CHARTEVENT_KEYDOWN)
     {
      до=(datetime) MathFloor(TimeCurrent()/60)*60;
      от=(datetime) MathMax(до-60*колкоминуткиданарисуваме,0);
      Print("от "+(string)от+" до "+(string)до);

      //ArrayResize(muhrates,1000,0);
      //int i = 0;
      //while(i<1000)
      //  {
      //   muhrates[i].open=1.0;
      //   muhrates[i].high=1.0;
      //   muhrates[i].low=1.0;
      //   muhrates[i].close=1.0;
      //   muhrates[i].tick_volume=50;
      //   muhrates[i].time=от+60*i;
      //   i++;
      //  }
      //Print("rates add: "+(string)CustomRatesUpdate(kyp,muhrates));

      Print("тикс копи: "+(string)CopyTicks(_Symbol,muhticks,COPY_TICKS_ALL,от*1000,20000));
      //Print("тикс репляс: "+(string)CustomTicksReplace(kyp,0,(до+60)*1000,muhticks));
      Print("тикс ад: "+(string)CustomTicksAdd(kyp,muhticks));
      Print("ерорръ кодъ ако има: "+(string)GetLastError());
     } 
  }

//+------------------------------------------------------------------+