Forum

Deinitializing with Visualization Tool in Mind

I am trying to debug my deinitialization with the visualizer, but I don't see any evidence of deinitialization in the visualizer's Journal. Is there a way to get normal deinitialization in the Visualizer Tool? Here is the basic EA I wrote to check to see if I could get any reactionary print in the

No DEAL_ENTRY_OUT? How do I determine a deal closes a Position?

I am running into an issue, where every time I request the DEAL_ENTRY, only DEAL_ENTRY_IN is returned. This occurs no matter if I am looking at a ticket for the entry of a position vs the ticket for the exit of a position. Based on some research, this may be a bug. If this is correct, what is the

What is wrong with CopyTicks

I am building a Indicator to look at Tick Imbalances. However, sometimes the indicator works while other times it crashes the terminal. I have narrowed down the issue to be the call to CopyTick calls. More specifically this function Code: int get_ticks( const datetime from, const datetime to

Are Built-In Indicators Pre-computed in Strategy Tester?

As the title says, are built-in indicators pre-computed in the strategy tester ? I was wondering if the only overhead for theses indicator functions (i.e iMA) is just extracting the values from the buffer? I couldn't find anything the documentation, but I don't want to assume things

Is there static cast in MQL4?

I was looking in the documentation and I only find run-time casting (<dynamic_cast>) but I was wondering if static_cast is available in MQL4? If not, is there a workaround to implement static polymorphism in MQL4

What Makes Indicators So Fast

I am curious, MT4 indicators seem to use slow algorithms. For example, Ichimoku computes the maxes and mins by just looking back at the given input look back period as opposed to having an efficient data structure do it. It also keeps many buffers that are O(n) size where n is the number of bars in

Finding Performance Bottlenecks in EAs

My question is when developing an EA in MQL4, what are the best ways to finding the things in your code that are slowing backtesting the most? For example, can I see which lines are causing the CPU the most problem (I know something so literal might not exist, but what about a workaround)

How to Clean up Static Pointer Attributes

So I am trying to implement a class (whose incomplete code can be seen below). In its implementation, I want to use a static pointer to help with static operations. However, I don't know what would be the best way to delete that pointer's memory upon de-initialization (I know I can implicitly delete

Declaring Template Class Variables

Hey, I have implemented this Queue that takes any type. I want to use like this since I don't know the max size at time of initialization: Queue< double > q; // Work q = Queue< double >( 20 ); // Where 20 is the max size of the queue This causes the following errors: " '>'- unexpected token", " '20'

Sequential Backtest Optimization

To my knowledge MT4 runs on a single-thread. Is this assumption correct with respect to the strategy tester , that it does not start another combination of parameters until the current one is finished running