[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 144

 
100yan:

For the beauty of the solution it is necessary to refer to the MA,

you need to calculate the period of the MA...

i.e. from a particular result of a function, find the period of the MA used in that function? to do this, you need to see the function
 
eddy:
i.e. from a specific function result find the MA period used in that function? for that you need to see the function


Nope... The function is a flag and uses the MA period as an internal parameter...

In order not to remember the period of the MA because it varies - the period of the MA needs to be defined within the function...

 
todem:
just use Object delete ///
The easiest way is to use ObjectsDeleteAll(EMPTY,OBJ_ARROW). My indicator draws arrows for a day and at the end of the working session at 16:45 they are to be deleted (ObjectsDeleteAll(EMPTY,OBJ_ARROW)), the line moves as planned to the end of the day (16:45), you can delete arrows by time (16:45) but there is an unpleasant detail as an unfinished chart on holidays for example, and may not be a candle at 16:45 and then the line itself will move to the latest candle of the day even if the candle has a different time (no more than 16:45) for example 14:00, but here is a reason arrows will be removed only if some_time1 = 16:45.
 

Another question...

double iMA( string symbol, int timeframe, int period, int ma_shift, int ma_method, int applied_price, int shift)

int shift - is it the parameter we can change on the chart, i.e. shift?

or index of the value obtained from the indicator buffer (shift relative to the current bar by the specified number of periods back). I.e. I need to know the MA value 56 bars ago - hence int shift =56??? If not, how do I do it?

 

Hi all, has anyone come across a script for transferring trades from a trade history file ("Save as detailed report") of the terminal to a chart...?

The scripts:fromRepOnGraph204.mq4 and fromHistoryInFile.mq4 are not suitable.

 
100yan:


Nope... The function is a flag and uses the MA period as an internal parameter...

To avoid remembering the MA period because it varies - the MA period needs to be defined within the function...

where does it change? Where does it change, look at it.
 
eddy:
Where does it change? Where does it change, that's where you see it.

Thanks for that! If you don't mind... I need to know the MA value 56 bars back - hence int shift =56??? If not, how do I do it?
 
yes
 
        HighesBuffer[i]=0;
        LowesBuffer[i]=99999;
      for(k=i; k<i+KPeriod; k++){ // максимумы и минимумы
       HighesBuffer[i]=MathMax(HighesBuffer[i],High[k]); //if(High[k]>max) max=High[k];
        LowesBuffer[i]=MathMin(LowesBuffer[i], Low[k]);} //if(Low[k]<min) min=Low[k];
      double sumhigh=HighesBuffer[i]-LowesBuffer[i],   // диапазон
             sumlow=Close[i]-LowesBuffer[i];           // положение цены в диапазоне
            MainBuffer[i]=sumlow/sumhigh*100;
why does my MainBuffer[i] exceed 100? where is the error?
 
eddy:
yes

Thank you!