Reply

Regarding Previous Thread – Risk In Money Used With Variable Stop

3 replies

RJL

Customer, bbp_participant, community, 67 replies.

Visit profile

8 years ago #114284

Sorry, but the previous thread I started on this is absolutely useless as it for some reason won’t let me respond properly. https://strategyquant.com/forum/topic/3781-risk-a-fixed-amount-with-variable-stop-losses-ie-atr-based/

 

I’m still looking for a solution in EA Wizard to base my lot size risk in money, taking in to account a variable Stop Loss using ATR.

 

I know it’s a function in Strategy Quant already, but trying to figure out how to simple transfer the code that is responsible for this money management rule in to my EA source code is proving extremely difficult. 

 

If anyone can help it would be greatly appreciated.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

8 years ago #133281

So you want to have your risk size be calculated using ATR? I am not sure. Provide an example

0

RJL

Customer, bbp_participant, community, 67 replies.

Visit profile

8 years ago #133289

Hi Tomas,

 

I want my lot size to be calculated based on ATR and SL distance, as I use a multiple of ATR as my SL, and I only ever want to risk £100 per trade, however the SL in pips will almost always be different as it’s based on ATR.

 

 

Trade 1 example:

 

GBPUSD

 

The ATR(14) = 35pips.

 

My SL parameter is set at 2 * ATR(14), so my SL distance on this trade is essentially 70pips.

 

 

Trade 2.

 

GBPUSD

 

The ATR(14) is now 27pips, so my SL distance on this trade would be 52pips.

 

 

Rather than just having each trade open with the same lot size, I want the EA to work out what my lot size should be based on the sum of 2 * ATR(14), and also considering the max I want to risk on this trade is £100.

 

So trade 1 would need a lot size of 0.22 to risk approximately £100. And trade 2 would need a lot size of 0.29.

 

This way I’m risking the exact same amount on every trade, irrespective of the actual SL distance.

 

Also, what I don’t want to do is risk a % of account equity, as this would then recalculate every trade and the monetary amount being risked would not remain constant as I would like.

 

Is this possible, or can this feature be added to EA Wizard? It’s a feature already available in StrategyQuant.

 

Thanks for your time.

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

8 years ago #133358

Hi,

 

I created an example for you. Look at the attached file

 

I defined RISK_PIPS_TRADE variable which is your maximum risk per trade. Since you want to risk let’s say 200 USD. If each pip equals 10 USD now you have 20 pips of risk available.

Then you calculate ATR and convert it to pips let’s say you need 30 pips as ATR risk.

Lot size equals to = 20 / 30 = 0.6

Now you can enter a position with 0.6 lot

If you want to risk 2000 USD per trade (200 pips) you could take 6.6 lots with the same ATR value

 

Hope that helps

0

Viewing 3 replies - 1 through 3 (of 3 total)