Hi,
I need a simple function.
I know stop loss and fixed amount of money (let's say in USD).
I'd like to know, where SL should be placed.
Please, don't post some topics, libraries, big parts of code, that doesn't solve the exact problem...
Just something like
double LotsizeFromMoney(StopLoss, Money) {} //returns SL
I couldn't find it anywhere and I am looking for it for about 3 months, it really drives me mad.
question: I'd like to know, where SL should be placed.
|
|
Sorry, I explained wrong.
I know SL and amount of money that I want to loose when SL is hit.
I want to calculate lotsize from that. Just one goddamn function.
WHRoeder - sadly that's not the exact solution of the problem
Example - I know my SL is 40 pips and I want to loose $80 when SL is hit. I need to calculate lotsize.
PLAESE DON'T POST ANY OTHER THINGS. TRY TO POST ONE, WORKING FUNCTION. THANKS
question: . TRY TO POST ONE, WORKING FUNCTION.
Example - I know my SL is 40 pips and I want to loose $80 when SL is hit. I need to calculate lotsize. |
Sorry, I didn't want to.
I just wanted to find the solution. I've already read those topics, but it has never worked for me.
Is that really that complicated? I just can't figure out the solution...
Ok, you posted this formula:
Account Balance * percent = RISK = (OrderOpenPrice - OrderStopLoss)*DIR * OrderLots * DeltaPerlot (Note OOP-OSL includes the SPREAD)
So for Lotsize it should be: Lotsize = Account Balance/(DIR*OrderOpenPrice*DeltaPerlot - DIR*OrderStopLoss*DeltaPerlot)
Is that correct? What is DIR?
Thanks
Sorry, I didn't want to.
I just wanted to find the solution. I've already read those topics, but it has never worked for me.
Is that really that complicated? I just can't figure out the solution...
Stop being petulant and at least attempt to understand what others are trying to tell you.
The formula is: lotsize = risk amount / stoploss value (i.e., lotsize equals risk amount divided by stoploss value)
Be careful about calculating stoploss value...you must calculate stoploss value correctly.
This site is replete with discussions and examples of how to calculate lotsize (here is my lotsize code). If you haven't been able to find anything for 3 months, you haven't been looking very hard. I suggest you search again and try to understand some of discussions you uncover regarding lotsize calculation.
question: What is DIR?
| +1 for a buy -1 for a sell |
Stop being petulant and at least attempt to understand what others are trying to tell you.
The formula is: lotsize = risk amount / stoploss value (i.e., lotsize equals risk amount divided by stoploss value)
Be careful about calculating stoploss value...you must calculate stoploss value correctly.
This site is replete with discussions and examples of how to calculate lotsize (here is my lotsize code). If you haven't been able to find anything for 3 months, you haven't been looking very hard. I suggest you search again and try to understand some of discussions you uncover regarding lotsize calculation.
Thanks for your answer. If I am not wrong , the code in link you posted solves when you want to get lotsize from % of balance.
Those things can be found easily, that's not the problem.
My question is, how can I improve the formula and make it finally usable? Should I multiply stoploss with PointValue like you do? Would that be a solution?
EDIT: Actually isn't, I am wrong again.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I need a simple function.
I know stop loss and fixed amount of money (let's say in USD).
I'd like to know, where SL should be placed.
Please, don't post some topics, libraries, big parts of code, that doesn't solve the exact problem...
Just something like
double LotsizeFromMoney(StopLoss, Money) {} //returns SL
I couldn't find it anywhere and I am looking for it for about 3 months, it really drives me mad.