Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1576
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
I have made this feature, thank you for your support and for your help.
You're welcome)It depends on how you are going to calculate stop and take based on statistics... It is not very clear what the "statistics by candlestick" is, how you calculate it.
The answer is like the whistle of a cancer and the strange thing is that it always answers my question.
The answer is like the whistling of a crayfish, and oddly enough, it's always the answer to my question.
How can you answer a question where you don't know what it is...? :)
In order to understand how to calculate the stop and take, in your case, you need to know how you calculate the statistics by candlestick? Because "candlestick stats" is a very broad term...
Also, what kind of stop and take ratio do you want...? There's a whole trading system to come up with for you here, as you don't even know the task at hand...How can you answer a question where it's not clear what it's about...? :)
In order to understand how to calculate stop and take, in your case, you need to know how you calculate candlestick stats? Since "candlestick stats" is a very flexible term...
Also, what stop and take ratio do you want...? There's a whole trading system to come up with for you here, as you don't even know the task at hand...int cnt,ticket,total=0;
st = "general hours Mon-Fri Wed-Wed Thu-Fri \n";
double cHeight, gHeight, max;
int sat, sun, mon, thu, wen, ths, fri; //, NN;
int H = TimeHour(TimeCurrent()); // determine the current hour
double NN = H + N*24; // define offset
if (NN>Bars) NN=Bars;
for (int t=0; t<24; t++)
{
int HeightZ = 0; int z=0;
for (int i=0; i<=NNN; i++)
{
HeightZ = MathAbs(High[i]-Low[i])/Point ;
z++;
}
What options do you suggest?As far as I understand, your motion is calculated as bar height(MathAbs were not needed).
и
here you are trying to calculate the number of bars... But it's better to set it as just a positive number, for starters.
You can calculate the average bar movement like this:
Now, you can try to calculate the stop and take based on the result of the function.
Help me to position the function correctly
Inserted it for the position entry message here
And I'm already successfully getting notifications on my smartphone.
But how and where to insert
SendNotification
To get a message when I reach stop loss ortake profit?
Help to position the function correctly
Inserted it for the position entry message here
And I'm already successfully getting notifications on my smartphone.
But how and where to insert
To get a message when I reach Stop Loss orTake Profit?
See OnTradeTransaction
Eugen8519:
But how and where to insert
To send a message when Stop Loss orTake Profit is reached?
First, you need to create a function to control the closing of orders.
First, we need to create a function to control the closing of orders.
OnTradeTransaction will be triggered when any stop order on the server is triggered.
First, we have to create a function to control the closing of orders.