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
Risk depends on your initial stop loss, lot size, and the value of the symbol. It does not depend on margin and leverage. No SL means you have infinite risk (on leveraged symbols). Never risk more than a small percentage of your trading funds, certainly less than 2% per trade, 6% total.
You place the stop where it needs to be — where the reason for the trade is no longer valid. E.g. trading a support bounce, the stop goes below the support.
AccountBalance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the spread, and DeltaPerLot is usually around $10/PIP, but it takes account of the exchange rates of the pair vs. your account currency.)
Do NOT use TickValue by itself - DeltaPerLot and verify that MODE_TICKVALUE is returning a value in your deposit currency, as promised by the documentation, or whether it is returning a value in the instrument's base currency.
MODE_TICKVALUE is not reliable on non-fx instruments with many brokers - MQL4 programming forum (2017)
Is there an universal solution for Tick value? - Currency Pairs - General - MQL5 programming forum (2018)
Lot value calculation off by a factor of 100 - MQL5 programming forum (2019)
You must normalize lots properly and check against min and max.
You must also check Free Margin to avoid stop out
For MT5, see 'Money Fixed Risk' - MQL5 Code Base (2017)
Most pairs are worth about $10 per PIP. A $5 risk with a (very small) 5 PIP SL is $5/$10/5 or 0.1 Lots maximum.
First of all, Happy New Year To all!
Now, i am sorry if i am slow with my responses, but you guys must understand that i do this in my spare time.
also, please try to be specific with your requirements in plain english, i usually wont be checking out links or videos.
Yasar Sari's requirements are what i am looking for, explained in plain english and understandable.
i will be working on it and share the results here in a couple of days.
in all, i WILL respond, even if i may be slow. just bear with me. thanks
I would be very happy if you could do this.
hi,
yes, i will work on your requirement. i understand it i think, and hopefully share a code in a couple of days. kindly bear with me
hi,
yes, i will work on your requirement. i understand it i think, and hopefully share a code in a couple of days. kindly bear with me
Thanks, I'm waiting
Thanks, I'm waiting
heres the code u need
since u r not using any stop loss, i have included an overall equity fall value to terminate the ea. u can set it as u like, i made it user input.
when terminating, the ea will leave positions as it is, u will have to handle them manually.
also, if u open a manual position, that position will become the latest position and any subsequent positions will be opened from there.
also, i have made tp for first position and subsequent positions a user input so u can adjust them as u like.
same goes for price drop for new positions, u can modify that too
i have included an executable file for your testing.
settings can be changed while running the ea, but new settings will take effect on new positions not already opened positions.
let me know if u like it or if u want some changes.
i wont be able to share the code for the whole executable as it contains a lot of commercial code as well, but i have shared the code pertaining to your needs above.
u would just need to address the GetTotalOpenPositions(), OpenABuyPosition(double lotSize, double SL, double TP) and GetLatestTicketNumber() functions.
there can be improvements to this, but i just coded exactly what u wanted for now.
tests shows it to work just like you wrote, but i will take ur word on it
<ex5 file deleted>
Please remember the requirements for the existence of this thread as outlined by a moderator. You should supply only open source code files and not executable files.
Also, you should post the code either as an attached file or by using code functionality that posting offers. So, please edit your post (don't create a new post) and replace your code properly (with "</>" or Alt-S), or attach the original file directly with the "+ Attach file" button below the text box.
Please take note of Fernando's comments above.
Post code properly and only post code that will compile.
If you are not willing to post/attach the complete source code, then this thread is not in the spirit of the forum.
I will wait for the moment and see what your response is, but I will likely delete this thread.
Please take note of Fernando's comments above.
Post code properly and only post code that will compile.
If you are not willing to post/attach the complete source code, then this thread is not in the spirit of the forum.
I will wait for the moment and see what your response is, but I will likely delete this thread.
ok, i cannot possibly share the original code, but i will rewrite the missing functions and edit my response when i am done. could take a bit of time so please be patient.
in the mean time, can you direct me to a forum where i can share my work as executables instead of source code. I mean, i dont mind sharing the code which i write myself, like i did above, but since i use a main template file to create my ea's, i cannot possibly share the entire code. That would be like giving away my lifes work for free.
so i WILL be sharing the new code that i add to make the request possible, but not the entire code from my template.
but yes, if i create an entire code from scratch, i will definitely share it in full.
the above code is pretty simple, so i wont mind coding the missing functions separately and making it compilable, but u must understand, it wont always be possible.
if there is another section here which would cater to my needs, i would be obliged to be directed there. i need the exercise to improve my skills afterall.
thanks in advance.
ok, i cannot possibly share the original code, but i will rewrite the missing functions and edit my response when i am done. could take a bit of time so please be patient.
in the mean time, can you direct me to a forum where i can share my work as executables instead of source code. I mean, i dont mind sharing the code which i write myself, like i did above, but since i use a main template file to create my ea's, i cannot possibly share the entire code. That would be like giving away my lifes work for free.
so i WILL be sharing the new code that i add to make the request possible, but not the entire code from my template.
I cannot direct you to another forum.
This thread is already being treated with suspicion by some moderators. This type of thread is often used by developers to get a list of people who they then send a PM offering the coding in exchange for money. This may or may not be the case here but if anyone reports such spam by PM the developer can expect to be banned.