multi time frame starts painting when first tick arrives.

 

Hello everyone. I have a multi time frame indicator which does not load in closed market. Actually starts painting when first tick arrives.

Do you have any idea? I can send you the code also.

 
Yashar Seyyedin:

Hello everyone. I have a multi time frame indicator which does not load in closed market. Actually starts painting when first tick arrives.

Do you have any idea? I can send you the code also.

my crystalball tells me that you may be using it on Oncalculate() function which only runs when market is open.

If you want more details without using crystalball, kindly show code.

 
Yashar Seyyedin:

Hello everyone. I have a multi time frame indicator which does not load in closed market. Actually starts painting when first tick arrives.

Do you have any idea? I can send you the code also.

Hello 

Is there a condition that executes when prev_calculated is >0 ?


☕️ ⚽️

 
Arpit T #:

my crystalball tells me that you may be using it on Oncalculate() function which only runs when market is open.

If you want more details without using crystalball, kindly show code.

I think chatGPT has hijacked your crystal ball . OnCalculate() executes at least once with all the data available .

😇

 
Lorentzos Roussos #:

I think chatGPT has hijacked your crystal ball . OnCalculate() executes at least once with all the data available .

😇

1. No there is no condition like prev_calculated is >0 

2. In fact It works fine with strategy tester. But in closed market no!

 
Yashar Seyyedin #:

If you want help with your code, paste it here.

I have deleted your last 2 posts. This is a public forum and not the place to make private arrangements.

 
Lorentzos Roussos #: I think chatGPT has hijacked your crystal ball . OnCalculate() executes at least once with all the data available .

Possibly twice, before a new tick.

Don't try to use any price (or indicator) or server related functions in OnInit (or on load or in OnTimer before you've received a tick), as there may be no connection/chart yet:
  1. Terminal starts.
  2. Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
  3. OnInit is called.
  4. For indicators OnCalculate is called with any existing history.
  5. Human may have to enter password, connection to server begins.
  6. New history is received, OnCalculate called again.
  7. A new tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent, account information and prices are valid.
 
William Roeder #:

Possibly twice, before a new tick.

Thanks 
 
William Roeder #:

Possibly twice, before a new tick.

What do you mean by server related?
 
Yashar Seyyedin #:
What do you mean by server related?
This is the source.
Files:
OCC_MTF_92r.mq5  14 kb
 
Yashar Seyyedin #:
This is the source.

Okay, added a condition to run once so oncalculate fires once if true , i simplified an OCC_Shell indicator with 2 buffers high and low , and simplified the calls too to use buffers 

0 or 1 (instead of up to 21) , it draws both on the limited oncalculate and the unlimited . i hope it helps even though i found nothing .

Reason: