Dukascopy
 
 
Wiki JStore Search Login

How to check for specific open positions before proceeding.
 Post subject: How to check for specific open positions before proceeding. Post rating: 0   New post Posted: Mon 22 Oct, 2018, 07:15 

User rating: 0
Joined: Thu 18 Oct, 2018, 15:37
Posts: 2
Location: Canada,
My strategy has a few different types of positions it may open. It is based on On Candle logic primarily but responsive trades can be opened via Trade Event. Before opening any new trade On Candle, I want to be certain that there are no open trades of a certain type. This makes the Open Positions variable less than ideal because that only considers all trades together without identifying which they are. However, for testing purposes, I tried it. It won't work with an If block comparing it to zero because it throws an error saying it can't compare it.

I cannot figure out if Position Viewer will work. Every which way I've tried it, it won't. This should be very simple. I have put together a pretty involved strategy which runs, but I cannot figure out how to implement this! Any help would be appreciated. The resource material on Position Viewer and Loop Viewer are pretty limited.

One other thing. There is one spot I noticed on my historical testing where it opens a trade it shouldn't. There is a simple If block to compare the close of one candle to the high of the previous. It should only open the trade if the close of the second is higher than the high the preceding one. It opens the trade despite the opposite being the case every time I run it. I put a breakpoint in and step through it and I can verify the numbers it is using. I definitely have the line coming out of the block right and this is the only spot I have seen it fail. I think it is about 10 PIPs too so it isn't that close. Is this a known issue?

Thanks in advance to anyone who can help!


 
 Post subject: Re: How to check for specific open positions before proceeding. Post rating: 0   New post Posted: Tue 11 Dec, 2018, 17:52 
Visual JForex expert at Dukascopy
User avatar

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

For that case you can mark positions in Comments field with any specific text, and then go through all open positions counting that have the same text comment.
Also that is how you can differ positions opened by the strategy and manually.

7.6. How to identify and work with positions - Visual JForex Manual https://www.dukascopy.com/vfhelper/down ... _locale=EN


Kind regards, Support Team.


 

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