EA doesn't calculate lot size on AUS cfds like it does on US cfds, currencies and cryptos. - page 2
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
Please note that according to your table, WES.asx is reporting a Tick Value of 0.0, which is invalid and will mess with your calculation. Your broker is not reporting it correctly.
Here is my take on the script:
Thanks so much, very helpful. Could you please explain this to me? I've added the following code to workout the 'proposed risk ($)' of the position using the lotsize calculated from the above script.
Simplified, that formula is: risk amount = point value * risk lots * risk points.
On SHOP.nyse (left) and GPS.nyse this looks like:
So what's happening with SHOP here is that the CheckOpenShort function determined to use the minimum lot size but because the distance between the entry and sl is so big the proposed risk $ exceeds 2% balance, whereas GPS's proposed risk $ was limited to 2% because the entry to sl distance was so much smaller. So I have to do this test on the returned lot size to confirm it doesn't exceed 2% of balance. The more expensive the stock the more points will be involved in a 1% movement.
Thanks for helping me understand that!
So what's happening with SHOP here is that the CheckOpenShort function determined to use the minimum lot size but because the distance between the entry and sl is so big the proposed risk $ exceeds 2% balance, whereas GPS's proposed risk $ was limited to 2% because the entry to sl distance was so much smaller. So I have to do this test on the returned lot size to confirm it doesn't exceed 2% of balance. The more expensive the stock the more points will be involved in a 1% movement.
Thanks for helping me understand that!
Your equation for the proposed risk is incorrect. You should use the Tick Size and Tick value as follows: {Volume] x [Stop Loss Size] x [Tick Value] / [Tick Size]
Given that for SHOP, the broker's minimum volume is 10 Lots, then the risk will be higher than the desired 2% risk. If less then 10 lots were allowed then the volume would have been 1.38 Lots.
Since the contract size does not allow it, then you only have 3 options:
Your equation for the proposed risk is incorrect. You should use the Tick Size and Tick value as follows: {Volume] x [Stop Loss Size] x [Tick Value] / [Tick Size]
Given that for SHOP, the broker's minimum volume is 10 Lots, then the risk will be higher than the desired 2% risk. If less then 10 lots were allowed then the volume would have been 1.38 Lots.
Since the contract size does not allow it, then you only have 3 options:
I tried both the way you suggested in the quote above and using [Point]. Point appears to provide a correct calcuation of proposed risk $ on GSE. On USDJPY neither point nor tickvalue and ticksize provide a correct calculation of proposed risk $. The lot size does seem right though.
Your advice much appreciated.
Please note, that in your code, you are dividing your Stop-Loss size by Point size before calculating the risk with Tick Value and Tick Size. That is incorrect.
Please note, that in your code, you are dividing your Stop-Loss size by Point size before calculating the risk with Tick Value and Tick Size. That is incorrect.
It's working! Thanks Fernando. I also didn't know about fabs() which is a helpful function. <3.
I wrote two examples a long time ago ( Money Fixed Risk and Money Fixed Margin ) - these examples clearly show what will happen if you set Stop Loss and if you work without Stop Loss.
Thanks for the resource.