FORTS: To help beginners - page 9

 
Dmi3:

What's the point of this deep thought here?

To keep you from writing nonsense

 
Alexey Viktorov:

And after that, legs up to the chin...

:)

 
prostotrader:

Lest you write nonsense

Any Position function will show nonsense at certain moments if there is more than one algorithm running on the instrument. If there are more than one hundred algorithms working on the symbol, these functions will almost always show rubbish.

For programmers of indicator EAs on the Market, like you, they make coding easier. That's what they are made for :)

I think I will conclude my communication with you at this point.

 
Dmi3:

Any Position function will show nonsense at certain times if there is more than one algorithm running on the instrument. If there are more than a hundred algorithms running on the instrument, these functions show nonsense almost always.

For programmers of indicator EAs on the Market, like you, they make coding easier. That's what they are made for :)

I think I am going to finish my communication with you at this point.

It is very good that you gave up.

Code

//+------------------------------------------------------------------+
//|                                                Test_PosSelet.mq5 |
//|                                      Copyright 2021 prostotrader |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021 prostotrader"
#property link      "https://www.mql5.com"
#property version   "1.00"

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
    if(PositionSelect(Symbol()) == true)
    {
      double vol = PositionGetDouble(POSITION_VOLUME);
      double price = PositionGetDouble(POSITION_PRICE_OPEN);
      Print("Chart ID: ", ChartID(), "; Pos rrice open: ", price,  "; Pos volume: ", vol);
    }
    else Print("Chart ID: ", ChartID(), "; Function not work!");
  }

Screenshot


Result

2021.02.19 21:54:14.774 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342797262733; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:15.725 Test_PosSelet (RTS-3.21,M1)     Chart ID: 132582340710023350; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:15.725 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342041799523; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:15.725 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342216199498; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:15.725 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342355167447; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:15.725 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582341172109780; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:15.725 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582341667948140; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:15.725 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342797262733; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:15.725 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342657884761; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:15.725 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582341893791058; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:16.452 Test_PosSelet (RTS-3.21,M1)     Chart ID: 132582340710023350; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:16.452 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582341172109780; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:16.452 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582341667948140; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:16.452 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582341893791058; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:16.452 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342355167447; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:16.452 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342216199498; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:16.452 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342041799523; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:16.452 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342657884761; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:16.452 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342797262733; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:17.762 Test_PosSelet (RTS-3.21,M1)     Chart ID: 132582340710023350; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:17.762 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342041799523; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:17.762 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582341667948140; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:17.762 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582341893791058; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:17.762 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582341172109780; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:17.762 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342657884761; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:17.762 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342355167447; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:17.762 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342216199498; Pos rrice open: 146540.0; Pos volume: 1.0
2021.02.19 21:54:17.762 Test_PosSelet (RTS-3.21,H1)     Chart ID: 132582342797262733; Pos rrice open: 146540.0; Pos volume: 1.0

There's a lot of talkative "going on" around here ....

 
prostotrader:

It's very good to get off.

Code

Screenshot


Result

Lots of talkative "going around" here ....

Someday, when you move from trading in test and demo mode to the real market, try consistently about the following:

-buy algo 1 2 lots

-Sell algo 2 3 lots

-Buy 1 4 lots

etc.

then request Position on any of the algos.

But anyway, stay in your junior group, you are comfortable here.

 
Dmi3:

Someday, when you move from trading in test and demo mode to the real market, try the following in sequence approximately

-buy algo 1 2 lots

-Sell algo 2 3 lots

-Buy 1 4 lots

etc.

then request Position on any of the algos.

But anyway, stay in your junior group, you're comfortable here.

Don't you need to pick your nose?

Free

 
One popular film comes to mind - The Fabulous D...b.)
 
Dmitriy Skub:
One popular film comes to mind - The Fabulous D...b.)

oak?

 
Valeriy Yastremskiy:

oak?

Almost, but longer)
 
prostotrader:

Don't you need to pick your nose?

Free

As usual, you have nothing to say about the matter?

Reason: