Dukascopy
 
 
Wiki JStore Search Login

ProfitLoss
 Post subject: ProfitLoss Post rating: 0   New post Posted: Thu 17 Jul, 2014, 18:17 
User avatar

User rating: 0
Joined: Tue 28 May, 2013, 16:00
Posts: 37
Location: Hungary, Győr
Dear Support!

How can i set in Visual Jforex, when the last closed order is Negative then not open position two day. My vfs it is true? :roll:

Thank you!


Attachments:
Negativ.vfs [38.53 KiB]
Downloaded 66 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: ProfitLoss Post rating: 0   New post Posted: Fri 18 Jul, 2014, 15:37 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi there,

Your strategy is not really doing what you expected as several conditions are not figuring into it.
You have to somehow 'think like the system' in order to breakdown your specifications into simple conditions : Stop trading for 2 days involves a time calculation and it is better to work with "Date and Time" format. Also, adding a "trigger variable" helps a lot in order to distribute the flow following the conditions: in the attached example the variable GO is acting as a trigger to separate positive / negative P&L in addition to the 2 days off-trading.

Please review the attached example and test it and let us know your comments if any.

Thanks


Attachments:
TradeIn2days.vfs [38.77 KiB]
Downloaded 108 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: ProfitLoss Post rating: 0   New post Posted: Sun 20 Jul, 2014, 11:29 
User avatar

User rating: 0
Joined: Tue 28 May, 2013, 16:00
Posts: 37
Location: Hungary, Győr
Thank you!

Yes, two day It's long time. I dont know why not double the lot size when the last pos negative. what is the problem in lot calculation? More description in vfs.
In backtest can not see that work the Lot calculation.
Sorry for low english skill.
thank you!


Attachments:
Negativ.vfs [48.03 KiB]
Downloaded 96 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: ProfitLoss Post rating: 0   New post Posted: Mon 21 Jul, 2014, 14:15 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

After reviewing your strategy we noticed the following errors:
1/ The strategy starts with no currency pair subscription, hence the default instrument in VJF is EURUSD, but a proper subscription will avoid errors.
2/ Your "Profit" variable is a double type variable with no start value (better to assign 0 to any double variable and to make sure it takes the needed value afterwords).
3/ You strategy starts with the upper "Profit" variable that takes the value the last trade P&L but the problem is that there will be no value till no trades are done. In other words, the strategy will never starts because "Profit" is equal to "Null" and because the strategy will wait till a position is created/closed then a message is generated to calculate the related P&L.
4/ Your lot calculation is never reset to the default value (it will keep doubled for profitable trades and therefore there is a risk of Margin cut) and doesn't have any start value. Please keep in mind that Default amounts are set in Million (0.001 --> 1000)


 
 Post subject: Re: ProfitLoss Post rating: 0   New post Posted: Tue 22 Jul, 2014, 18:00 
User avatar

User rating: 0
Joined: Tue 28 May, 2013, 16:00
Posts: 37
Location: Hungary, Győr
Hi,

But in backtest open positions and could filter the negativ and positiv closed positions. Only the lot calculation problem. :/ :(


 
 Post subject: Re: ProfitLoss Post rating: 0   New post Posted: Wed 23 Jul, 2014, 16:32 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

Sorry, I did not understand your question/comment can you please express it differently ?
The strategy previously posted is generating several errors and doesn't trade so far due to reasons posted above.

Thanks


 
 Post subject: Re: ProfitLoss Post rating: 0   New post Posted: Thu 24 Jul, 2014, 09:23 
User avatar

User rating: 0
Joined: Tue 28 May, 2013, 16:00
Posts: 37
Location: Hungary, Győr
Hi,

Sorry :/ so i set difference SL and TP in .vfs for present the filter. When the profit < 0 then TP and SL 300. When the profit >=0 TP and SL 600. Can you see in Bbands block. Open the program positions and can calculate the profit variable, but the pastLOT and LOT variable calculations not work.

Thank you for help!
Image


Attachments:
Negativ.vfs [49.12 KiB]
Downloaded 101 times
Chart_XAU_USD_Hourly_snapshot.png [51.65 KiB]
Downloaded 358 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: ProfitLoss Post rating: 0   New post Posted: Thu 24 Jul, 2014, 15:47 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Alright,

Please find attached an example of strategy that handle profit/loss and multiply lot size accordingly. Please use this as a pattern and study it in order to adapt it to your idea.

In case this ain't help you please post your question in the Russian speakers section of VJF forum.

Thanks !


Attachments:
SampleMG.vfs [62.75 KiB]
Downloaded 117 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 

Jump to:  

  © 1998-2024 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