Alain Verleyen:
The opening of a position is linked to the first deal of this position. So check the magic of this deal.
the positions i'm considering are closed. (so i'm only watching for the deals that are of type DEAL_TYPE_OUT).The opening of a position is linked to the first deal of this position. So check the magic of this deal.
so the question is :
is there a way to find the ticket of the deal, that is the DEAL_TYPE_IN linked to the DEAL_TYPE_OUT one i'm currently considering ?
Code2219 or probably 2319:
the positions i'm considering are closed. (so i'm only watching for the deals that are of type DEAL_TYPE_OUT).
so the question is :
is there a way to find the ticket of the deal, that is the DEAL_TYPE_IN linked to the DEAL_TYPE_OUT one i'm currently considering ?
Yes, each deal has a DEAL_POSITION_ID property, with it you can find all deals related to a position, and from there find the first one.
the positions i'm considering are closed. (so i'm only watching for the deals that are of type DEAL_TYPE_OUT).
so the question is :
is there a way to find the ticket of the deal, that is the DEAL_TYPE_IN linked to the DEAL_TYPE_OUT one i'm currently considering ?
Alain Verleyen:
Yes, each deal has a DEAL_POSITION_ID property, with it you can find all deals related to a position, and from there find the first one.
Yes, each deal has a DEAL_POSITION_ID property, with it you can find all deals related to a position, and from there find the first one.
BIG THANKS, and my EA will be complete soon.
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
Ok, here i'm stuck on any idea on how to do this procedure. [not looking for codes, you see. just any help on how-to]
How to count number of closed EA-positions, in the last day (or week or so) ?----------------------------------------------------------------------------------------------------------------------------------
Short version of the question :
I know how to populate History list, and search through deals (through a desired time, say last 24 hrs), find the positions that were opened by EA.
BUT, how to detect if a closed position was originally opened by my EA ? (since all closed positions I checked, have magic number = 0)
----------------------------------------------------------------------------------------------------------------------------------
Long version of the question :
Inside the chart-analyzer part of my EA, there's a variable to assess short-term success/fail rate of EA on recent trades.
one thing is to set a bool to true on some-conditions. (PRUDENT_MODE = true) , this variable affects behavior of EA on next signals/patterns it finds.
In order to set this bool, I need to count the positions that were opened by my EA, in last 24 hours, and check the profit/loss ratio of the last 20 positions.
i.e : (assuming I've already checked all error-raiser flags...)