[EA] Cost Of Trading

1
Hi

I created a small EA that compute the Cost Of Trading in realtime
you need to use "ticks based on history" mode

Cost Of Trading depends on two factors :
1) The spread of the asset of course
2) The volatility of the asset (if there is higher volatility, the profits will be higher, so positions will be smaller thus less cost) and its price

This shows that some assets aren't worth trying (indices) while other are cheap enough (forex, stocks, crypto)
formula is simply:

Code: Select all

 cost_[i] = spread / ((atr /c)*100.0);
where c is bid, ask or (ask+bid)/2.0

you can put any asset in the settings

here is an example of output:
from 2/6/2021 to 11/3/2021 :
(first value is the current price of trading, mean is the mean from the beginning

Code: Select all

Cost of asset AUDUSD = 46.17 (mean = 11.97)
Cost of asset AUDCAD = 141.2 (mean = 56.09)
Cost of asset UK100 = 1327.74 (mean = 688.89)
Cost of asset US30 = 838.06 (mean = 1434.11)
Cost of asset US500 = 131.3 (mean = 276.77)
Cost of asset ABT.NYSE = 41.69 (mean = 63.11)
Cost of asset ANTM.NYSE = 305.17 (mean = 266.7)
Cost of asset DRE.NYSE = 41.51 (mean = 43.81)
Cost of asset CAT.NYSE = 172.87 (mean = 133.12)
Cost of asset LTCUSD = 45.46 (mean = 72.2)

if you want the code let me know


Re: [EA] Cost Of Trading

3
ionone wrote: Sat Feb 27, 2021 7:14 pm what the heck, here is the code
:)

Jeff

EDIT: US30 (1434.11) is 100 times more expensive than AUDUSD (11.97 ) !! for the period tested
think about it, you need a 100 times better edge if you trade US30
which is huge...
I don't see how people can be profitable with indexes this must be impossible, unless you trade VERY slowly (like weekly or monthly maybe)
indexes are calculated in points usually you need to divide by 100 to get the pip value.

so a 1400 spread on us30 is actually almost 0 considering us30 can move 1000 points in a day

you need to include point calculation for your ea for 'unusual 'pip calculation asset ie : indexes , gold , oil , cfds etc etc etc

only currencies use pip , all the rest needs separate calculation method.


Who is online

Users browsing this forum: ralf_dias and 2 guests