Dukascopy
 
 
Wiki JStore Search Login

Position Summary
 Post subject: Position Summary Post rating: 0   New post Posted: Thu 14 May, 2020, 16:06 
User avatar

User rating: 0
Joined: Fri 22 Sep, 2017, 08:50
Posts: 2
Location: SwitzerlandSwitzerland
Hallo, is it possibile to get position summary via vjf?

I need to get the amount of total opend positions. If for example 13 positions are open. 7x short with 10.000 and 6 x long with 10.000. Then I have to have the sum and the strategy should indicate that at the moment a sum of 10.000 short is open.

I can program the strategy so that the strategy adds and subtracts the individual positions and thus always gives me the sum. The problem is that sometimes the strategy opens 2 positions at the same time and therefore the strategy can only count 1 position.

So is there a way how I can always get the current sum of the positions?

Ask for your support.

Many thanks


 
 Post subject: Re: Position Summary Post rating: 0   New post Posted: Tue 19 May, 2020, 16:37 
Visual JForex expert at Dukascopy
User avatar

User rating:
Joined: Mon 22 Apr, 2013, 11:30
Posts: 591
Location: UkraineUkraine
Greetings.

For that you can use Position Viewer going through Open Positions and adding to Sum variable if position is long and subtracting if short.
For more info please attach the strategy file with the problem that you've described.

Regards.


 
 Post subject: Re: Position Summary Post rating: 0   New post Posted: Tue 26 May, 2020, 09:54 
User avatar

User rating: 0
Joined: Fri 22 Sep, 2017, 08:50
Posts: 2
Location: SwitzerlandSwitzerland
Hallo, the problem is when the strategy opens 2 positions at the same time due to different entry points. So with the block "LastTradeEvent, Trade Massage Type, Position Filled" you can only calculate one position and the second position remains unknown. Do you have an idea how to avoid this?

Thanx a lot.


 
 Post subject: Re: Position Summary Post rating: 0   New post Posted: Tue 26 May, 2020, 17:23 
Visual JForex expert at Dukascopy
User avatar

User rating:
Joined: Mon 22 Apr, 2013, 11:30
Posts: 591
Location: UkraineUkraine
If strategy is opening two positions, LastTradeEvent will be triggered two times one by one.
On the first position execution Open Positions amount will be 1, on the second position - it will be 2.

Regards.


 

Jump to:  

cron
  © 1998-2011 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com