Coding help - page 23

 

...

paijowijaya,

That code will never return a result of 0.0002

It will return result in pips as a whole number and some decimal value. For a close-open difference on a 5 digit broker it will give results ranging from nnn.0 to nnn.9 pips. As far as I understood, the whole point is to "standardize" the difference to a meaningfull value and that code does just that - standardizes result as a nnn.n pips for each and every symbol on each and every broker. Try it out and then you will see what results it gives

regards

Mladen

paijowijaya:
Big surprise I am very happy that you responds to my question Master Mladen,

But sorry I am still confused, would you give complete coding? Value * 100000 I meant to be easy in the readings, not 0.0002 (4 digits behind the comma), but if you have an easier way, I will follow your way. In essence, when found three candles (the balance zone or buyers = sellers or side way zone, each TF its different number of candles) which is small (its value is taken from the difference between Close - Open) I want to draw a horizontal line just as the picture I've uploaded. So I know the supply and demand in the chart with the help of the line. Or is there such an indicator that you have?

My Best Regards,

Thank you Master Mladen
 

Modify an EA

Hello everyone,

I've found a very good expert advisor which, if well modified can made a lot of pips.

The EA is called Big Dog, and unfortunately I can't find who made it.

The EA is quite easy you just put a time box and he took the low and the high and put a sell order under the low and a buy order over the high, so as you understood is a brake-out EA.

The only problem is that it hasn't a lot of features.

It has:

First Take Profit

Second Take Profit

Trailing Stop

Use Stop Loss (yes or no)

Stop Loss

Lots

Slippage

WindowStart

WindowEnd

Use Money Management (yes or no)

Account Is Micro (yes or no)

Risk

Now.. the second stop loss don't work, would be good to fix it.. and I would like to add:

first take profit 30%

second take profit 30%

thirty take profit 30%

fourth take profit 10%

at each take profit reach move stop loss to the previous one.

BE automatically

orders 3 or 4 pips over/under the high/low

Delate opposite orders when take profit is hit

If we can modify this EA with this features I can guarantee that putting the time 07/09 gmt with the pairs EURUSD, GBPUSD, AUDUSD, NZDUSD, USDCHF, USDCAD we can have really nice profits and if the first take profit is low at 15pips, is almost always hit.

You can google big dog brake-out.

If anyone is interested and know how to modify this EA please comment, would be a great help for everyone.

Have a nice day!big_dog.mq4

Files:
big_dog.mq4  9 kb
 

...

paijowijaya

You have to find the exact bars at which you want the minimum and maximum looked for at. As far as I see you are trying to find those at peaks so I suggest you use some kind of a zigzag to find the exact bar at which you should start seeking for minimum and maximum. Seeking peaks is never a "one way street" and frankly, I have no idea how did you imagine where exactly you want to look for minimum and maximum values from the pictures you posted. The code I posted was supposed to help you in coding (as the name of the thread is saying) not to make your complete indicator

regards

Mladen

paijowijaya:
Master Mladen,

Master, How the indicator is supposed to look for 3 candles shaped as small as we want to do above and below the price that is being moved and re-looking small candles again if prices have gone through and leave a horizontal line that Master Mladen.

Since I will be:

if iLow ((NULL, PERIOD_H4, 1) upper_limit)) Buy== true; if iHigh ((NULL, PERIOD_H4, 1) >lower_limit && iClose(( NULL, PERIOD_H4,1)> lower_limit)) Sell== true;

Indicator that you submit is always looking for 3 candle mengikuri price so that the line is always walking the price. If the indicator is like this, I could not use the above command in my EA.

My Best Regards,

Thank you Master Mladen
 

Master Mladen, There are errors of perception

mladen:
paijowijaya,

As far as I understood, the whole point is to "standardize" the difference to a meaningfull value and that code does just that - standardizes result as a nnn.n pips for each and every symbol on each and every broker. Try it out and then you will see what results it gives

regards

Mladen

Master Mladen,

Master, How the indicator is supposed to look for 3 candles shaped as small as we want to do above and below the price that is being moved and re-looking small candles again if prices have gone through and leave a horizontal line that. Indicator like this what I need Master Mladen.

I will be said at my EA (For example):

if iLow ((NULL, PERIOD_H4, 1) upper_limit)) Buy== true; if iHigh ((NULL, PERIOD_H4, 1) >lower_limit && iClose(( NULL, PERIOD_H4,1)< lower_limit)) Sell== true;

Indicator that you submit is always looking for 3 candle following the price so that the line is always walking with the price. If the indicator is like this, I could not use the above command in my EA. So I said there are errors of perception .Sorry my inglish not good.

My Best Regards,

Thank you Master Mladen

 
mladen:
paijowijaya

The code I posted was supposed to help you in coding (as the name of the thread is saying) not to make your complete indicator

regards

Mladen

Yes I understand your intent, but that's what I do not understand how to make it to identify three candles above and below the current price. Okey no problem Master Mladen, I say many thanks for all the prompts and hopefully I can find a way to make it a fixed line is not running follow the price of your instructions. Once again many thanks for all your response and guidance.

Best Regards,

Thank you Master Mladen

 

...

paijowijaya

In this example :
double highest = High; double lowest = Low;

the number 3 int the calls to iHighest() and iLowest() functions before the startFromBar parameter means that it should check 3 bars and find bar numbers of highest high and lowest low in those 3 bars. The startFromBar is the starting bar from which it starts to count the 3 bars.

paijowijaya:
Yes I understand your intent, but that's what I do not understand how to make it to identify three candles above and below the current price. Okey no problem Master Mladen, I say many thanks for all the prompts and hopefully I can find a way to make it a fixed line is not running follow the price of your instructions. Once again many thanks for all your response and guidance.

Best Regards,

Thank you Master Mladen
 

...

And how does the indicator "knows" that it should draw those lines at exact those spots? I mean clear rules. Without that (the "knowing where") it can not draw anything, and from what I see they are drawn at almost randomly chosen points

paijowijaya:
Master Mladen,

Master how about at the pic what I upload, here H1 EURUSD now.

And I want line Draw from average open 3 candles and average close 3 candles for the upper and lower limit,not from high or low. I also want line draw aboveand below price now. How the coding Master Mladen ? Thank you before.

My Best Regards

Thank you Master Mladen
 
mladen:
paijowijaya In this example :
double highest = High; double lowest = Low;
the number 3 int the calls to iHighest() and iLowest() functions before the startFromBar parameter means that it should check 3 bars and find bar numbers of highest high and lowest low in those 3 bars. The startFromBar is the starting bar from which it starts to count the 3 bars.

Master Mladen,

Master how about at the pic what I upload, here H1 EURUSD now. Just now you said "startFromBar" how about this situation Master ? And how if I want to have the option of the situation in H1, H4 and D1?

And I want line drawn from Open the farthest and Close the farthest from those 3 candles for the upper and lower limit lines, not from high or low. I also want line drawn above and below price now not at price now. In this case I want to identify only an area is not high low, an area that we limit the maximum only consists of 3 candles that form small body at H1, H4 and D1. How the coding Master Mladen ? Thank you before.

My Best Regards

Thank you Master Mladen

Files:
 

...

paijowijaya

Sorry, but I can not help you. If someone understands what are you talking about then maybe that someone will also be able to help you. Since my questions remain unanswered and since I fail to understand what are you talking about, I can not

regards

Mladen

 
mladen:
And how does the indicator "knows" that it should draw those lines at exact those spots? I mean clear rules. Without that (the "knowing where") it can not draw anything, and from what I see they are drawn at almost randomly chosen points

Coding can tell if the candle No.1 is the farthest or highest Open among the other 3 candles ---> create horizontal line, and if the candle No.1 has a value farthest or highest Close among the other 3 candles ---> create horizontal line, If it does not look to the candle no.2 and 3, if all the same, take the open and close on one of the three candles that exist. I think this could be set, because we can change the number of candles is not only 3, maybe 2 maybe 4, maybe 5. Master Mladen What do you think?

My teacher said, should be upper and lower limit lines drawn from the body candle not from highlow candle, how about this, Master Mladen? I am confused how to said. That is just limit area line (as long as it is in identifying the 3 small-bodied candle) but if drawn from Highlow actually no problem but the limit line to be too large.

My Best Regards,

Thank you Master Mladen

Files: