Re: Coding Help

203
Dearest Experts
Here is an EA that one of our member posted today,i have few questions regarding that as for learning purpose
1 : if the ea is hard coded
2 : what means for "#property strict" - if and when some values from ea property changed if it will not be work ?
3 : i did inactive "#propertty strict" - then it produce errors
4 : which one lines/part of code belongs to "#property strict"
regards
belonging indicators are attached too.
Indicator is just a tool.

Use it only if it can benefit you. Leave it if you don't know how to use it optimally.

Re: Coding Help

204
mntiwana wrote: Sat Apr 29, 2017 2:00 am Dearest Experts
Here is an EA that one of our member posted today,i have few questions regarding that as for learning purpose
1 : if the ea is hard coded
2 : what means for "#property strict" - if and when some values from ea property changed if it will not be work ?
3 : i did inactive "#propertty strict" - then it produce errors
4 : which one lines/part of code belongs to "#property strict"
regards
belonging indicators are attached too.
1. about "hard code" - if we take the strict definition of it, it is not (you can change the important parameters : stop loss, take profit, and indicators parameters)
2. about strict - according to mq strict is "Compiler directive for strict compilation mode" - some of the rules that must be applied in strict mode are not the same when you don't use that mode and vice versa
3. that is because of the point 2.
4. not some specific line - they all do belong to the compiler switching to strict compilation mode

Re: Coding Help

205
mladen wrote: Sat Apr 29, 2017 3:18 am 1. about "hard code" - if we take the strict definition of it, it is not (you can change the important parameters : stop loss, take profit, and indicators parameters)
2. about strict - according to mq strict is "Compiler directive for strict compilation mode" - some of the rules that must be applied in strict mode are not the same when you don't use that mode and vice versa
3. that is because of the point 2.
4. not some specific line - they all do belong to the compiler switching to strict compilation mode
Dearest MLADEN
So much thanks for detailed explanations,what i understand,ea is not hard coded and "#property strict" belongs to only compilation not to ea/indicator functional behavior - so the ea was not working with the guy because of some of parameters/features were not properly applied/adjusted
regards
Indicator is just a tool.

Use it only if it can benefit you. Leave it if you don't know how to use it optimally.


Re: Coding Help

206
mntiwana wrote: Sat Apr 29, 2017 3:34 am Dearest MLADEN
So much thanks for detailed explanations,what i understand,ea is not hard coded and "#property strict" belongs to only compilation not to ea/indicator functional behavior - so the ea was not working with the guy because of some of parameters/features were not properly applied/adjusted
regards
The thing is simple :

- there is no code that would prevent that EA to work on live account
- usually when it works on back testing and does not work on a live, the issue is in prices (or slippage) - some brokers demand that the slippage can not be 0, and stop loss and take profit values must be checked in live trading (which are usually ignored in back testing)

But all that can be found out if the user opens the journal and experts tab and see hat kind of an error did he get from the broker side

Re: Coding Help

207
mladen wrote: Sat Apr 29, 2017 3:41 am The thing is simple :

- there is no code that would prevent that EA to work on live account
- usually when it works on back testing and does not work on a live, the issue is in prices (or slippage) - some brokers demand that the slippage can not be 0, and stop loss and take profit values must be checked in live trading (which are usually ignored in back testing)

But all that can be found out if the user opens the journal and experts tab and see hat kind of an error did he get from the broker side
Dearest MLADEN
Once Again thanks for taking time,all i was curious to know,why that was not working with him,so i tried to do exact things,for example i open the time limitations from "00.00 to 24.00" then apply on M1 with decreasing some values for to fast test and adjust every thing accordingly as per my little knowledge but it visible on M1 chart when default parameters but not working (as in setting it have higher TF and higher values for some parameters with time limitation from 07.00 to 17.00) - and when changed values other than default it was invisible at chart,means removed automatically,that is why i asked for hard coded.
regards
Indicator is just a tool.

Use it only if it can benefit you. Leave it if you don't know how to use it optimally.

Re: Coding Help

208
I have a set of indicators which are set up to monitor one currency each. They are all in their own sub-windows. I am noticing on one chart sub-window there may be a "big move" upwards and on another a "big move" downwards. But when I look at the "numbers" the magnitude of the change can be _very_ different with one being several times more than the other. So really only one is doing the big move and the other is tiny but looks big because of the scale.

I am trying to capture the indicator maximum and minimum so as to subtract them to measure / report range.

This is what I tried:

double scale_range;
scale_range = NormalizeDouble((INDICATOR_MAXIMUM - INDICATOR_MINIMUM),0);

so then I can print the result using:
ObjectSetText("MaxMin",DoubleToStr(scale_range,0),FontSize,FontName,clrWhite);

It compiled normally, without errors ..... but it does not work as I hoped. It reports "0.0".

My question is: Is what I am trying to achieve possible? .. and if so, what do I need to differently?

Can anyone see my error or folly? Any comments would be appreciated.

Re: Coding Help

209
I don't see how I can edit/update my earlier query.

The problem I am trying to solve is associated with the MT4 auto-scaling.
Since posting the above, I have manually entered the scale maximum and scale minimum and get the result I am trying to measure. So my question is simply .... Is there a way to automatically capture the scale max and scale min values showing on the right side of the sub-window so I can avoid the need to periodically review/update changes in values?

Re: Coding Help

210
Newton51 wrote: Sun Apr 30, 2017 10:27 am I don't see how I can edit/update my earlier query.

The problem I am trying to solve is associated with the MT4 auto-scaling.
Since posting the above, I have manually entered the scale maximum and scale minimum and get the result I am trying to measure. So my question is simply .... Is there a way to automatically capture the scale max and scale min values showing on the right side of the sub-window so I can avoid the need to periodically review/update changes in values?
If you mean fixed maximal an minimal value for a sub-window, as far as I know, there is no way to know that dynamically


Who is online

Users browsing this forum: No registered users and 17 guests