Target 1 @ 1.0700 & target 2 monthly pivot ?.We shall see.
Cheers
Code: Select all
int start()
{
// calculate the zoomfactor as pixels per bar
int x1,x2,y,zoomfactor;
bool result;
result=ChartTimePriceToXY(0,0,iTime(NULL,0,0),0,x1,y);
result=ChartTimePriceToXY(0,0,iTime(NULL,0,1),0,x2,y);
zoomfactor=x1-x2;Have a look into the MQ4 manual for ChartTimePriceToXY(). You might understand the code then.heart1010 wrote: I had a short view into the code and wondering of that "result" lines (2nd overrights 1st but result are never used later)![]()
Code: Select all
int start() { // calculate the zoomfactor as pixels per bar int x1,x2,y,zoomfactor; bool result; result=ChartTimePriceToXY(0,0,iTime(NULL,0,0),0,x1,y); result=ChartTimePriceToXY(0,0,iTime(NULL,0,1),0,x2,y); zoomfactor=x1-x2;
I dont know of any command in MQ4 to "shift bars to the right". The bars are objects on the time axis and there is a bunch of code needed to calculate their positions as new bars appear. As well as on changed timeframe, zoomfactor etc. And as the chart timeframe can be bigger than the timeframe for the pivot calculation it is even more complex.Then your indicator is doing all the work/for loops again and again on every tick. Is this really needed or couldn't we save here some CPU and only do that once a bar or when a new high/low is printed?
The pivot calculations are all based on prices of the past, so we have to that only once, don't we? So we only had to shift the objects to the right on every new bar without any new calcualtions done![]()
:
Maybe in a later version.vinvlad » 29 Mar 2017, 18:39 wrote:Big thanks to Tomele for the development.![]()
Is it possible to add a GMT shift ?
