I'll break this down to you.
1. You want the stoploss to be above 1 then why have you already made an external input that is static ?
every order that is sent through, the stoploss will keep changing, you need to customize your stoploss using a function.
2. You would want to capture the value of 1 and have it stored as a static variable in a seperate function, once the criteria (signal) is met, that saved value can be inputted as a stop loss with the calculation of the current market price that you opened the order.
3. For example, if you would want to loop every other high,
this actually takes more precise methods including capturing the high value every hour.
The code for what you are asking for is quite rare to see on this forum and interesting to analyze. I hope the above helped expand on what you need to do.
I'll break this down to you.
1. You want the stoploss to be above 1 then why have you already made an external input that is static ?
every order that is sent through, the stoploss will keep changing, you need to customize your stoploss using a function.
2. You would want to capture the value of 1 and have it stored as a static variable in a seperate function, once the criteria (signal) is met, that saved value can be inputted as a stop loss with the calculation of the current market price that you opened the order.
3. For example, if you would want to loop every other high,
this actually takes more precise methods including capturing the high value every hour.
The code for what you are asking for is quite rare to see on this forum and interesting to analyze. I hope the above helped expand on what you need to do.
Hiii, but the problem is that i dont know how to capture the value of nº 1. Do you know how to code it?
Hiii, but the problem is that i dont know how to capture the value of nº 1. Do you know how to code it?
With some thinking ability it is most probable I can code something like this, I suggest looking into topics:
yeah nice, but how can i set the highest as the stop loss?
You need to go through the topics I've said enough to get you started here is some code that can lead up to looking for your stoploss.
Look for the highest value using --> iHighest command return the bar number that has the highest value ----> double valuehigh(){ } return the value of which bar is the highest ----> Close[ bar number] Sort the value on the OnTick using AlertTime so your EA is not overworking every tick ---> using Time[0] Calculate the price by using the Bid price when the signal occurs. Or if you want, you can do this in an array which is better imo. But that code should give you an idea of what to do and look for. Read through the material I sent over and you can definitely achieve something like this.
You need to go through the topics I've said enough to get you started here is some code that can lead up to looking for your stoploss.
Hey thanks, i tried it but i have some problems. I want the high maximum not the high price (Nº 1 in the image) I code this but its is not what i want.
double valuehigh=(Close[iHighest(NULL,0,MODE_HIGH,100,0)]);
Hey thanks, i tried it but i have some problems. I want the high maximum not the high price (Nº 1 in the image) I code this but its is not what i want.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I´m coding an EA that just sells and I code the patron i want the expert follows but i dont know how to set the stop loss where i want (VIEW IMAGE) Here is my code, please help me.