Example: counting all POSITIONS (for all characters, for all Magic number)
//+------------------------------------------------------------------+ //| Calculate all positions | //+------------------------------------------------------------------+ int CalculateAllPositions() { int total=0; for(int i=PositionsTotal()-1; i>=0; i--) if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties total++; //--- return(total); }
Example: counting all POSITIONS (for all characters, for all Magic number)
HI Vladimir.
Do I replace the whole section or just add that to the top?
HI Vladimir.
Do I replace the whole section or just add that to the top?
The function itself (CalculateAllPositions ()) should be BELOW OnInit, OnTick, OnTradeTransaction.
A function call (CalculateAllPositions ()) is usually made from OnTick.
HI,
looks great.. I will try that.
Will the coding work on an Indicator?
You know, sometimes I like to check - sometimes checking an idea is faster than waiting for an answer :)
HI.
It looks like some of the coding doesn't work on my Indicators.
What I am trying to do is display profits per day for the week and the month.
I'm still trying to work that out from your sent me.
I will try and bring some of the indicator into the EA. and see how that goes.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi..
I am creating a dashboard for my totals.
I have 99% of it working. Just having issues with the OrdersTotal for the daily and weekly figures.
this is what is should look like
But should have numbers in the fields..
pls help