Forum

Hide all indicator data after a certain date

I would like to hide all indicators data on the chart after the date of a vertical line drawn (named "RANGE_END"). For example in the following diagrams, left chart is before the vertical line is drawn, right chart is when the vertical line is added, I would like to hide all the data after the line

Custom symbol gaps in price data

I have written a custom symbol to calculate USD index based on all the crosses against USD using the synthetic instrument formula. If I start my PC after a period of time, I find a gap in the index. The custom symbol does not seem to recalculate on the historical prices for the backfill period. I

How to position multiple arrows properly on a single date in multiple timeframe and window size

I need to draw multiple arrows on a single date. It works for one time frame but when I resize the window or change to another time frame, the arrows overlapped. Here is the sample code: // h is the high of the bar at object_date // first arrow ObjectCreate ( 0 ,object_name1, OBJ_ARROW , 0

Trapping mouse select-drag-drop events

My indicator tracks a date set by a vertical line every second (set by timer). A long calculation is called if the vertical line is changed. But when I click on the vertical line, while dragging to another price-bar and before releasing the click, the long calculation is called with whenever date

Forward declaration compilation error

The following gives CBuffer struct undefined compilation error, please help: class C1dArray; class C1dBuffer; class CBuffer; class C1dIntArray; class C1dArray { C1dBuffer *m_1dBuffer; }; class C1dIntArray: public C1dArray { }; class C1dBuffer { CBuffer m_buffer; C1dIntArray m_index; };

Debugging undeleted objects

After executing a program, it reported a few undeleted objects of certain type. How to find out where are these undeleted objects? Is there a way to access the calling function stack? I am thinking a solution to store the calling stack at the object constructor so that I can track the various

Restricting use of template

I am trying to use template to define an array: template < typename T> class C 1 dArray { T m_array[]; public : // some non computational methods int size() { return ArraySize(m_array); } // some computational methods T average() { T s= 0 ; for ( int i= 0 ;i< ArraySize (m_array);i++) s+=m_array[i];

Using template to define n-dimension array

I understand that template <typename T> can be used to define a container class of type T at compile time. For example: template <typename T> class C1dArray { T m_array[]; public: // and methods that deal with 1darray operations }; I can define C1dArray<int> and it will be an array of integers

How to use class forward declaration?

I am trying to build a 1d array that can take in 2d array as index and return another 2d array with the contend of 1d array: C1dArray < int > labels = {10,11}; C2dArray < int > index = {{0,1,1,0},{1,0,0,1}}; labels[index] will return {{10,11,11,10},{11,10,10,11}} 3 sample files are attached that

Getting price data aligned to a time

Very often we need to code our indicator to display a historical point in time to check if the data calculated and the signal generated during backtest are the same and also we need a way to paper trade visually to validate our strategy before embark to code an EA. For illustration, if our strategy