Coding help - page 455

 
abmmalay:
hello traders/ coders

any one help me with this indicator, i need a small help that i need to a alert with pop up window for this indicator

alert 1 tenkan - kijun cross

alert 2 senkou A- senkou B cross

with pop up window

thanks in advance

abmmalay

Did you check this thread for it : https://www.mql5.com/en/forum/180648 ?

 
robbob1970:
Hi, hoping someone can help with this. Found this code over at cAlgo and hope someone can convert it to mq4 Many thanks in advance

So with my vary limited skills I managed to knock this custom indicator up.

breakout_channel.mq4

Its a simple PA channel. However I know there's a bug somewhere because when you first load it the chart looks like this

If someone could look at the code and tell me where I went wrong it would be greatly appreciated.

It would also be really cool if a draw rectangle function could be added to identify extended periods where price is trending/Channeling so it would look a little something like this

As you can see the boxes highlight an area of demand with the theory being that when the price moves away from these zones it will continue to move until a new supply zone is reached.

 

Following up from the previous post I also knocked up a variate.

breakout_channel_ii.mq4

Same problem when it first loads it looks like this

Once it loaded it runs fine and gives a channel that looks like this

What would be good if someone could smooth out the channels and get rid of the "V" peaks and valleys

Because when you apply both indicators you have a really good system

 

Привет Младен! Я хочу сделать индикатор EMA, которая показывает на графике линии ЕМА на другой tf.No не работает, где ошибка.ema.mq4

Files:
ema.mq4  9 kb
 
aria:
Привет Младен! Я хочу сделать индикатор EMA, которая показывает на графике линии ЕМА на другой tf.No не работает, где ошибка.ema.mq4

aria

You are duplicating OnInit() function and buffers declaration

Check this version to see how it can be handled (one time frame) https://www.mql5.com/en/forum/173574/page442 and then you can extend it to any number of time frames

 

Mladen ! Spasibo !!! (поцелуй)

 
mladen:
stevenpun

All seems to be working OK for me

See the example attached : _test_1.mq4

_________________________

As of shift : all shift does is it shifts the indicator display on chart. Current bar value is still O-th element of buffer and so on regardless where it is displayed. Shift does not change that. It just makes it appear as if it is a value of another bar

Hello mladen may i ask you one more question .

About the buy and sell signal , how can i get the signal buy when the slope green and sell by red ?

now i was writing by this

if ( Ma_Bid_Diff > MAOpenDistance && Bid > MA_Signal ) Signal = 1; //buy if ( Ma_Bid_Diff > MAOpenDistance && Bid < MA_Signal ) Signal = -1;//sell

Now i was forward test , it was open sell when the slope is green color .

Is that some things wrong with the code ?

 
stevenpun:
Hello mladen may i ask you one more question .

About the buy and sell signal , how can i get the signal buy when the slope green and sell by red ?

now i was writing by this

if ( Ma_Bid_Diff > MAOpenDistance && Bid > MA_Signal ) Signal = 1; //buy if ( Ma_Bid_Diff > MAOpenDistance && Bid < MA_Signal ) Signal = -1;//sell

Now i was forward test , it was open sell when the slope is green color .

Is that some things wrong with the code ?

stevenpun

Like this :

double MA_Signal_now = iCustom(Symbol(),0,"NonLag ma nrp 2 nmc",NlmPeriod,NlmPrice,PctFilter,Shift,3,1);

double MA_Signal_prv = iCustom(Symbol(),0,"NonLag ma nrp 2 nmc",NlmPeriod,NlmPrice,PctFilter,Shift,3,2);

if (MA_Signal_now!=MA_Signal_prv)

{

if (MA_Signal_now== 1) // code for buy

if (MA_Signal_now==-1) // code for sell

}

 

There Mladen.

I have been trying to implement standard deviation into my EA.

It when i do so the EA fails to take any trades during backtesting in strategy tester. If i remove the standard deviation it will trade again.

And i am 120% sure the conditions are met. i have gone trough the trading logic over and over. Ive even tried to remove everything just leaving the logic:

Standard deviation period 20 > 5

AND

Standard deviation period 20 > standard period 20 shift 3

(both sell and buy conditions)

AND

for sell

SMA period 12 < SMA period 12 shift 3

OR

for buy

SMA period 12 > SMA period 12 shift 3

Trade on completed bars.

Still no trades so i wonder if you or someone else can tell me if my syntax for standard deviation has some errors.

iStdDev(Symbol(),0,20,0,MODE_SMA,PRICE_CLOSE,0)>6 iStdDev(Symbol(),0,20,0,MODE_SMA,PRICE_CLOSE,0)>iStdDev(Symbol(),0,20,0,MODE_SMA,PRICE_CLOSE,3)

My goal is to sucsessfully define a bollinger squeeze

Regards

Edit: Sorry i did just have an invalid lot size

 

Mladen ! Add the switching function na EMA. Smoothed.Linear Wieghted

Files: