Coding help - page 595

 

sorry, I use online translator, and this may not all understand, sorry again.

 
v2812:
is this the degree of tilt?

v2812

That is nothing

Change the horizontal scale (press zoom in or out) and the "angle" will stay the same even though it has been changed on the chart. As I told : forget about "angles" in financial time series. There are only some approximations (like the one I made when it is approximated to price change over some average range change) but there is nothing that can be called an exact mathematical angle when x and y axis of a coordinate system are not using same units

 

I wanted that when you change the scale of the graph the slope of this line remained the same, showing the strength of the movement moving averag

 

Look, the picture V5- line shows the slope of 69.0. In the picture V6 I shrunk the scale, but the slope of the line invariably 69.0. Suppose that the angle 69.0 the trend is strong, and we will know at any scale chart. I need it.

Files:
 
v2812:
Look, the picture V5- line shows the slope of 69.0. In the picture V6 I shrunk the scale, but the slope of the line invariably 69.0. Suppose that the angle 69.0 the trend is strong, and we will know at any scale chart. I need it.

v2812

Please read this post : https://www.mql5.com/en/forum/173056/page3

Hope that helps you understand what are we dealing with. All the best

 

if it's not a degree, but that it is immutable, so you can know that from 30 to 80, for example - strong trend, whatever the scale of the graph if the point is green(30 to 80), mean growing strong trend

 

Maybe it's not a degree but a specific value in numbers. Means to bind the color dots to the range these numbers

 
on my own:
I don't think that you can synchronize two things that are not synchronous (ticks from two different symbols)

Ok but I can ignore the synchronization of ticks because I am referring to the last close's price bar that is finished.

One question:

When the variable 'limit' is equal to 1, it means that I am considering the last bar memorized in the Timeseries Arrays whith index equal to 1 for both currency,

so they are the bar which are just completed.

How can be them influenced by tick of the current bar?

 
twinumbers:

Ok but I can ignore the synchronization of ticks because I am referring to the last close's price bar that is finished.

One question:

When the variable 'limit' is equal to 1, it means that I am considering the last bar memorized in the Timeseries Arrays whith index equal to 1 for both currency,

so they are the bar which are just completed.

How can be them influenced by tick of the current bar?

How do you know that the other symbol price id up to date?

 
apprentice coder:
How do you know that the other symbol price id up to date?

Here there is the code:

#property indicator_separate_window

#property indicator_buffers 1

#property indicator_color1 Red

#property indicator_width1 2

double Buffer[];

//int bars;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int OnInit()

{

//--- indicator buffers mapping

IndicatorBuffers(1);

SetIndexBuffer(0, Buffer,INDICATOR_DATA);

ArrayInitialize(Buffer,EMPTY_VALUE);

ArraySetAsSeries(Buffer,True);

//---

return(INIT_SUCCEEDED);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int OnCalculate(const int rates_total,

const int prev_calculated,

const datetime &time[],

const double &open[],

const double &high[],

const double &low[],

const double &close[],

const long &tick_volume[],

const long &volume[],

const int &spread[])

{

//---

if(prev_calculated == 0)

{

int i = rates_total-prev_calculated-1;

for (;i>0;i--)

Buffer = close-(iClose("GBPUSD", 0, i));

// bars = iBars("GBPUSD",0);

}

else

{

if(rates_total > prev_calculated)

// if( (rates_total > prev_calculated) && (iBars("GBPUSD",0) > bars) )

{

int limit = rates_total-prev_calculated;

Buffer[limit] = close[limit]-(iClose("GBPUSD", 0, limit));

// bars = iBars("GBPUSD",0);

Print("GBP:"+iClose("GBPUSD", 0, limit));

Print("EUR:"+close[limit]);

Print("limit: "+limit);

}

}

//--- return value of prev_calculated for next call

return(rates_total);

}

when each new bar comes, I print the last EURUSD and GBPUSD close's price, sometimes happening that the price printed is different from close's price of the last candle.

Furthermore if I attach the indicator for the second time on the chart it is visible the difference in the chart's indicator between it and that previous.

Reason: