Coding help - page 289

 
12BPRO:
Hi CODESGURUS,

I have a general question about multi time frame.... as attached

the first picture on the left hand side is a RSI indicator on a 5M timeframe...

On the second is the RSI multi time frame of the 5M on the 15M timeframe...

The question is why is there a difference in the value as indicated in the RED circle....

Can someone PLEASE explain and rectify this RsiMA-MTF codes........

You can not see a 5 minute rsi on a 15 minute chart (that is meaningless - since you can see only one value out of 3 that should be displayed on a 15 minute chart, and that means that you see only 1/3 of the rsi values).

 
12BPRO:

THIS IS A COPY OF THE RSI-MA........

THANKS ALL.....

best regards

AZRUL..........

PS... how do I attaced these FILES code in here..... Sorry for the mess....

Go to advanced and find the attachment button or press the manage attachments, and you will be guided from then on by the interface

 
mladen:
Go to advanced and find the attachment button or press the manage attachments, and you will be guided from then on by the interface

Hello Sir MLADEN....

Thanks for the tip.... next time I will post my files accordingly....

best regards

AZRUL....

 
mladen:
You can not see a 5 minute rsi on a 15 minute chart (that is meaningless - since you can see only one value out of 3 that should be displayed on a 15 minute chart, and that means that you see only 1/3 of the rsi values).

Dear Sir MLADEN,

I was mistaken to think that the MTF indicator would call the RSI M5 timeframe for every 15 Minute....

Sorry, I was just wondering.... how it would look like.....

Thanks..

 
12BPRO:
Dear Sir MLADEN,

I was mistaken to think that the MTF indicator would call the RSI M5 timeframe for every 15 Minute....

Sorry, I was just wondering.... how it would look like.....

Thanks..

Imagine this :

There are three 5 minute bar for each 15 minute bar. Value of which of the three 5 minute bars should be displayed on a 15 minute chart and why exactly that bar and not one of the other two?

That is why lower time frames can not be displayed on a higher time frame : significant data is lost and the data displayed is because of that faulty

 

Hello,

my post may have been missed but I wonder is there a format for getting year and quarter information for year and quarterly pivots

pgtips:
Hi,

Firstly an apology if this is in the wrong place, its a pivot indi i am looking at but my Q is in relation to coding, I could have put it in MTF as well but I thought this was best place to start.

In MT4 we have daily, weekly, monthly = W1, D1, MN1

but is there a year function, or a quarter function.

So for example in the attached pivot indicator how do you get 1 year, and is it (or can you choose) a rolling 12 months or a fixed prev year 2013 example. And same for how do I get it to calculate quarterly pivots.

Any guidance would be appreciated, attached is a monthly pivot indi. i am reasonably confident I can modify the attached but I do not know how to start to get the data into it to make it output quarters or year.

allpivots_monthly.mq4

Many thanks

Kevin

Thank you in advance for any help,

Kevin

 
pgtips:
Hello,

my post may have been missed but I wonder is there a format for getting year and quarter information for year and quarterly pivots

Thank you in advance for any help,

Kevin

Kevin

Yearly pivot you can download from here : https://www.mql5.com/en/forum/177028

Haven't seem a quarterly pivot as far as I remeber

 

thank you Mladen, I will look at this.

 
mladen:
Imagine this :

There are three 5 minute bar for each 15 minute bar. Value of which of the three 5 minute bars should be displayed on a 15 minute chart and why exactly that bar and not one of the other two?

That is why lower time frames can not be displayed on a higher time frame : significant data is lost and the data displayed is because of that faulty

Hello again Sir MLADEN....

Thanks for the above explanation.....

I have got a request for you....

Is there a way for an EA to keep a tab (calculate) on the accumulation of today's trading....

And if today's LOSS is greater than.. let say USD500.00 it will lock up ( or deny) any more order... for the day... and Alert the User...

PS... I have posted a new outcome of the Pollan Indy and it looks more promising...

The only problem for now is the SIDEWAYS market conditions.... so a lock up EA sound very interesting... HOPE you could HELP PLEASE....

yours truly

AZRUL....

Files:
v2-sideways.jpg  315 kb
 
12BPRO:
Hello again Sir MLADEN....

Thanks for the above explanation.....

I have got a request for you....

Is there a way for an EA to keep a tab (calculate) on the accumulation of today's trading....

And if today's LOSS is greater than.. let say USD500.00 it will lock up ( or deny) any more order... for the day... and Alert the User...

PS... I have posted a new outcome of the Pollan Indy and it looks more promising...

The only problem for now is the SIDEWAYS market conditions.... so a lock up EA sound very interesting... HOPE you could HELP PLEASE....

yours truly

AZRUL....

It is simple :

Place something like this at the beginning of the start() procedure of your EA and it will prevent it from working if the loss (or profit) already made that day exceeds some ammount :

double totalProfit=0;

for (int i =OrdersHistoryTotal()-1; i>=0; i--)

{

if (!OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)) continue;

if (OrderSymbol() != Symbol()) continue;

if (OrderMagicNumber() != someMagicNumber) continue;

if (iBarShift(Symbol(),PERIOD_D1,OrderCloseTime())==0)

if (OrderType()==OP_BUY || OrderType()==OP_SELL)

totalProfit += OrderProfit()+OrderCommission()+OrderSwap();

}

if (totalProfit < someProfitLossLimit) return(0);