![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Fellow programmers! We need your help.
I need to make an edit in the MT4 code. The Martin Expert Advisor puts a series of orders in order through the specified delta and, starting from some trade number (for example, the 4th trade), it starts to increase the delta by a coefficient.I need this delta not to be prolonged infinitely until the entire series is over. But only to a certain level, which we set in settings (for example Max_delta = 50 points). And when delta becomes >= Max_delta, it would take this value continuously until the series finishes. And then it would start from the beginning.
Here is the code of the program where the delta is stretched:
int Delta(int OrdNum){if(Start_order_delta>1){
if(OrdNum>Start_order_delta){
int p=OrdNum-Start_order_delta;
return(Take_profit*MathPow(Delta_exp,p))
}
}
return(Take_profit);
}
Please help me introduce a delta constraint into this code.
CHART_BRING_TO_TOP property
It can be set, but the current value cannot be determined.
ChartSetInteger(0,CHART_BRING_TO_TOP,true) - works.
ChartGetInteger(0,CHART_BRING_TO_TOP,0) - does not work.
CHART_BRING_TO_TOP property
It can be set, but the current value cannot be determined.
ChartSetInteger(0,CHART_BRING_TO_TOP,true) - works.
ChartGetInteger(0,CHART_BRING_TO_TOP,0) - doesn't work.
Well, everything makes sense. The call has three parameters, or am I mistaken?
Using the second option we just get the value set to false, not the current value.
As for getting the value - we need four parameters (the last one will contain the current value).
Well, that makes sense. The call has three parameters, or am I wrong?
Using the second option we just get the SET value of false, not define the current value.
As for getting the value - we need four parameters (the last one will contain current value).
Yes, you're wrong. Multiple ChartGetInteger entry forms are allowed.
But regardless of ChartGetInteger record formit is impossible to get the current value ofCHART_BRING_TO_TOP property.
Several ChartGetInteger entry forms are possible.
But regardless of the ChartGetInteger entry form ,it is not possible to get the current value of theCHART_BRING_TO_TOP property.
And what is the value returned by the second variant of ChartGetInteger function (4-parameter)? And the error code?
And what value does the second variant of the ChartGetInteger function (4-parameter) return ? And the error code?
Value 0; error 4109 - i.e. no such property exists.
According to the Handbook, this property is simply not supported:
For the second call, returns true if this property is supported and the value has been placed in the long_var variable, otherwise returns false.
The error code says the same thing. The question why the CHART_BRING_TO_TOP chart property is not supported is on the developer's level. And if the property is actually supported, then the question is again on their level: why in such a case the ChartGetInteger function returns false?
Why is the OnTick event not happening in the strategy tester. Build 586. I thought at first there was an error in my program. Started Moving Average.mq5 for debugging. Set a breakpoint at the first operator of the OnTick event. I didn't see any reaction within an hour.