Errors, bugs, questions - page 290

 
Interesting:
Are you interested in a specific position (known symbol and its Id) or a general case for all positions?
There are 3 positions in 3 different known instruments, we need to check when the signal to open, the time to change so that we don't add too often.
 
Interesting:

Are you interested in a specific position (symbol and its Id are known) or the general case for all positions?

If you just look through the history and analyze deals (using mydeal), then approximately so:

1. We obtain the total number of deals for the period, going through them and selecting only those according to the symbol and/or those that participated in forming the position

2. it is better to select deals not by symbol, but by specific position ID (it's easier and more reliable).

Although I am sure there are more correct and simple solutions.

Thanks for the solution.

I thought I was missing something in the standard library, there is an open time and change time is also an important parameter?

 
beginner:
There are 3 positions for 3 different known instruments, we should check at the time the signal to open, time to change not to add too often.

Then form it into a function with SymbolTitle and ID parameters (if you need ID).

And call the function from any place.

Cool option would be to create its descendant from CPositionInfo and add similar functionality to it.

PS

By the way, the developers - it would be nice to add to the standard library functionality for CPositionInfo, which at least automatically fills an array of deals for the selected position (I think there is no such thing yet).

 
Dima_S:

This is the kind of nonsense that came up in the log after the update command was executed on the graph:

2011.02.03 02:24:51 HistoryBase '#IBM' 1 invalid bars removed
2011.02.03 02:24:50 HistoryBase '#IBM' 1 invalid bars removed
2011.02.03 02:24:49 HistoryBase '#IBM' 1 invalid bars removed
2011.02.03 02:24:48 HistoryBase '#IBM' 1 invalid bars removed
2011.02.03 02:24:47 HistoryBase '#IBM' 1 invalid bars removed
2011.02.03 02:24:46 HistoryBase '#IBM' 1 invalid bars removed

etc every second.

TF Hourly

Thank you for your message. Corrected.
 
beginner:

Thanks for the solution.

I thought I had overlooked somewhere in the standard library, there is an open time and change time as an important parameter too?

What do you mean by 'position change time' ? What has to change there for you to notice the change ?
 
Valmars:
What do you mean by 'position change time' ? What has to change there for you to notice the change ?
Volume.
 
beginner:
Volume.

What's wrong with that :)

double vol1 =0.0;
double vol2 =0.0;
if(PositionSelect(Symbol1)) vol1=PositionGetDouble(POSITION_VOLUME);
if(PositionSelect(Symbol2)) vol2=PositionGetDouble(POSITION_VOLUME);
Print ("vol1=",vol1,"vol2=",vol2);
if (vol2<=vol1)
 
alexluek:

What's wrong with that :)

I wonder how I know from this that Symbol1' s position changed a minute ago.
 
Interesting:

By the way, the developers - it would be nice to add to the standard library functionality for CPositionInfo, which at least automatically fills an array of deals for the selected position (I think there is no such thing yet).

But there is a function HistorySelectByPosition(), which does the same thing, all we need to know the identifier of the position. And it allows to obtain the history for both existing positions, and for those already closed. What will your proposed method return? An array of deals on the existing position, or the entire history of the symbol? And if there is no position at the moment, what will it return?


 
beginner:
Volume.
The opening time of a position is always the same, while the change of volume (and/or direction) of a position during its existence can be multiple, and what, you want to get the whole array of time of position volume change with the help of the standard library method? The volume change is always a result of a trade, so you need to analyze the history of trades for a given position, and the time of a trade is reflected there. If you want to know the time of the last position change, you need to find the last deal of this position in the history, and look at what DEAL_TIME is for it.