Dukascopy
 
 
Wiki JStore Search Login

I want to make a Cost of Trade Custom Indicator
 Post subject: I want to make a Cost of Trade Custom Indicator Post rating: 0   New post Posted: Tue 07 Nov, 2017, 19:09 

User rating: 2
Joined: Fri 01 Sep, 2017, 12:14
Posts: 8
Location: GermanyGermany
Hi

I made this Indicator quite easily in MT4, but I do not know java and also have trouble to understand Visual JForex, maybe someone can help me out:

It is actually very simple, I need:
1. the value of the ATR of the last 5 closed daily candles (5ATR)
2. the live spread, updated with every tick (SPREAD)

Then I calculate the Cost, using these 2 Values:

( 1-(SPREAD / 5ATR) )*100 = Cost in %

example: ( 1-(0.00003 / 0.0072) )*100 = 99,58 %

I just need the % number in the corner of my chart, that is being updated with every tick, does anybody know how to do that?


 
 Post subject: Re: I want to make a Cost of Trade Custom Indicator Post rating: 1   New post Posted: Wed 08 Nov, 2017, 14:04 
Visual JForex expert at Dukascopy
User avatar

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

Attached an example.
Let me know if you have any questions


Attachments:
ATR_CostPerc.vfs [19.68 KiB]
Downloaded 87 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: I want to make a Cost of Trade Custom Indicator Post rating: 0   New post Posted: Wed 08 Nov, 2017, 16:22 

User rating: 2
Joined: Fri 01 Sep, 2017, 12:14
Posts: 8
Location: GermanyGermany
amine_chourou wrote:
Hi there,
Attached an example.
Let me know if you have any questions


Thank you, that looks good, is there a way to see the output of the calculation on the chart while the strategy is running?


 
 Post subject: Re: I want to make a Cost of Trade Custom Indicator Post rating: 0   New post Posted: Thu 09 Nov, 2017, 10:53 
Visual JForex expert at Dukascopy
User avatar

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

Well you already have in the file sent: See the outputs on the workspace ? (Spread, ATR5, Cost_inPerc) ? That's the way we debug values when the strategy is running. You can drag and drop any value used in the strategy on the workspace to see its real time value


 

Jump to:  

cron
  © 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