Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

ProfitLoss
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=146&t=51507
Page 1 of 1

Author:  stunczy [ Thu 17 Jul, 2014, 18:17 ]
Post subject:  ProfitLoss

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

Author:  amine_chourou [ Fri 18 Jul, 2014, 15:37 ]
Post subject:  Re: ProfitLoss

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

Author:  stunczy [ Sun 20 Jul, 2014, 11:29 ]
Post subject:  Re: ProfitLoss

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

Author:  amine_chourou [ Mon 21 Jul, 2014, 14:15 ]
Post subject:  Re: ProfitLoss

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)

Author:  stunczy [ Tue 22 Jul, 2014, 18:00 ]
Post subject:  Re: ProfitLoss

Hi,

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

Author:  amine_chourou [ Wed 23 Jul, 2014, 16:32 ]
Post subject:  Re: ProfitLoss

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

Author:  stunczy [ Thu 24 Jul, 2014, 09:23 ]
Post subject:  Re: ProfitLoss

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 359 times

Author:  amine_chourou [ Thu 24 Jul, 2014, 15:47 ]
Post subject:  Re: ProfitLoss

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 118 times

  Page 1 of 1