Risk per currency function

Avatar
  • updated
  • Fixed

I tested the function "risk per currency" to understand how it works.

Installed default set for 5 currency pairs on a demo account.

expertId:

eurusd - 1011

gbpusd - 1012

audusd - 1013

usdchf - 1014

usdjpy - 1015

Risk per currency properties (the same for each pair):

Type - by position number

Max risk value - 1.0

Opposite position calc mode - Netto Mode

Additional magic number list - 1011,1012,1013,1014,1015

Use semaphor - true

I expected the following:

with an open buy position on eurusd, positions will not be opened (until the eurusd position is opened):

buy - gbpusd, audusd

sell - usdchf, usdjpy

Further, I noticed that after the time elapsed, part of ea spontaneously turned off

From the EA logs, I noticed that at that moment an error occurred -  "invalid pointer access in 'RiskPerCurrency.mqh'". Also at this moment, a new signal appeared for another currency pair.

Has anyone encountered this? 
Is this a bug or incorrect settings EA?

And I understand the logic of the function correctly?

Pinned replies
Avatar
1
Andrey Khatimlianskyi
  • Answer

New parameter -- Consider only one position per EA (symbol/magic/type) -- is available in 2.54.11

Avatar
1
Andrey Khatimlianskyi
  • Answer

New parameter -- Consider only one position per EA (symbol/magic/type) -- is available in 2.54.11

Avatar
2
Kirill El

thanks, started testing