Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Fetch the current value of market price and multiply it with a variable
 Post subject: Fetch the current value of market price and multiply it with a variable Post rating: 0   New post Posted: Thu 21 Feb, 2013, 18:09 
User avatar

User rating: 0
Joined: Mon 02 Apr, 2012, 09:22
Posts: 12
Location: United Kingdom, London
To Dukascopy Support,

I wanted to have a take-profit which is 15 times the value of current market price.
For example, if the current market price of EURUSD is 1.3225, I want the take-profit to be 15 * 1.3225 = 19.8375 pips.

I tried to code the take-profit in the following manner :

double takeProfitPrice = history.getLastTick(instr) * 15;

But there is one error displayed :

The operator * is undefined for the argument type(s) ITick, double

Kindly suggest a way by which I can get the desired take-profit.

Regards,

Terry.


 
 Post subject: Re: Fetch the current value of market price and multiply it with a variable Post rating: 0   New post Posted: Fri 22 Feb, 2013, 10:05 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See the second snippet of:
https://www.dukascopy.com/wiki/#History_ticks/Last_tick


 

Jump to:  

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