Strategy Test become drastically slow (Visual Mode) after adding this indicator class to my strategy
Haven't tried to load and run this code, because it somewhat feels tedious to be honest.
But, read the indicator main file, it seems to me the limit calculation is responsible to one of the faults.
Maybe try to replace it with
limit = MathMin(rates_total-prev_calculated,min_rates_total);
Then your problem is not the class. It must be your code, or your tester speed setting.
Haven't tried to load and run this code, because it somewhat feels tedious to be honest.
But, read the indicator main file, it seems to me the limit calculation is responsible to one of the faults.
Maybe try to replace it with
@Amir Yacoby Thanks for reply.
With the change suggested, it does not find correct ZigZag points, as I got result Index as zero in my strategy.
Then your problem is not the class. It must be your code, or your tester speed setting.
@William Roeder thanks for reply.
I did not change anything in the code. Just added this class (before that tester was working and lighting speed !)) and found tester is working slow, so removed the class but still tester is slow.
I did check the tester speed, earlier at quarter of speed it was flying but now at full speed too it is dam slow.
Is there any way I can found if the code has problem ?
Also my work station has 8 cores but tester uses only Core 1, is there any setting need to be done to use all the cores ?
@Amir Yacoby Thanks for reply.
With the change suggested, it does not find correct ZigZag points, as I got result Index as zero in my strategy.
try
limit = MathMin(rates_total-prev_calculated,min_rates_total+1);
Because you clculate all the bars on each tick, so just check the minimum bars needed to calculate for correct zigzag logic, which should be in direct relation with min_rates_total
try
Because you clculate all the bars on each tick, so just check the minimum bars needed to calculate for correct zigzag logic, which should be in direct relation with min_rates_total
Hi Amir
Thanks for taking off your time to review my post.
However, I am of the opinion that the problem is in Indicator Class (not indicator) as it loops to find non zero values from indicator buffer.
I would be thankful, if you can spare some time to review the indicator class and see if my code does take too much resources.
Regards
Hi Amir
Thanks for taking off your time to review my post.
However, I am of the opinion that the problem is in Indicator Class (not indicator) as it loops to find non zero values from indicator buffer.
I would be thankful, if you can spare some time to review the indicator class and see if my code does take too much resources.
Regards
So how do you explain that without the class it's still not solved? And why the indicator needs to loop all bars on each tick? If you just place the indicator alone on a chart, like now it's weekend but you can place it on like BTCUSD which has ticks on weekends and see in the resources if it is heavy when standalone.
Or just test it alone with strategy testerHi Amir
Thanks for taking off your time to review my post.
However, I am of the opinion that the problem is in Indicator Class (not indicator) as it loops to find non zero values from indicator buffer.
I would be thankful, if you can spare some time to review the indicator class and see if my code does take too much resources.
Regards
Try with first limit calculation before first loop:
limit = MathMax((int)(rates_total-prev_calculated-SlowLength-1),(int)(SlowLength+1));
And second limit calculation before second loop
//+--------------------------------------------------------------------------------------------------------+ //| Calculate 'Minor' Swing High/Low //+--------------------------------------------------------------------------------------------------------+ limit = MathMax((int)(rates_total-prev_calculated-FastLength-1),(int)(FastLength+1)); Swing = 0; ...
Really? You previously posted: and now have removed that.
Hi William
What I mean to say after I added this class and related logic, the tester become very slow.
So I removed this class and related logic, but then the tester continued to be slow. Though before the first step of adding class, the tester was working very well.
There was no other changes.
Hope you got what I mean to say!!!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello Friends
I have created CiZigZag.mqh indicator class to get Major/Minor High/Low values. However after adding this class to my strategy, the tester speed has drastically reduced. Now even after I have removed this class, the tester has not restored to the earlier speed and still slow.
I hope the gurus here will help me out.
Attached are relevant files to run the class.