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.

Is there any function module in JForex client platform similar to Global Variable in MT4?
 Post subject: Is there any function module in JForex client platform similar to Global Variable in MT4? Post rating: 0   Post Posted: Thu 06 Sep, 2012, 03:59 

User rating: 0
Joined: Thu 16 Aug, 2012, 03:29
Posts: 26
Hello, experts,

I met a problem and wish you could give me a hand.

At first, the problem is for JForex client platform.

I need something like Global Variable module in MT4.

The Global Variables could be created, deleted and value-changed during the running process in a strategy either by users themselves or by program itself, which is very convenient for human-computer interaction.

@Configurable notations in JForex client platform is all right, nevertheles, users have to define all the variables for human-computer interaction at the beginning.

What should I do if I want some variables for interaction be created during some specific time in a Strategy?

Thank you so much!


 
 Post subject: Re: Is there any function module in JForex client platform similar to Global Variable in MT4? Post rating: 0   Post Posted: Thu 06 Sep, 2012, 07:47 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
blackkettle wrote:
@Configurable notations in JForex client platform is all right, nevertheles, users have to define all the variables for human-computer interaction at the beginning.
This is not the case:
  1. They "have to" only if the strategy logic forces them to do so.
  2. Parameters can be modified during the strategy run - in Tools -> Strategies then press Parameters button.


 
 Post subject: Re: Is there any function module in JForex client platform similar to Global Variable in MT4? Post rating: 0   Post Posted: Thu 06 Sep, 2012, 08:40 

User rating: 0
Joined: Thu 16 Aug, 2012, 03:29
Posts: 26
API Support wrote:
blackkettle wrote:
@Configurable notations in JForex client platform is all right, nevertheles, users have to define all the variables for human-computer interaction at the beginning.
This is not the case:
  1. They "have to" only if the strategy logic forces them to do so.
  2. Parameters can be modified during the strategy run - in Tools -> Strategies then press Parameters button.



Maybe I was not conveying my opinion clearly enough.

How could I do in the following specific case?

I want to assign two variables for each order submitted successfully.

One variable is for the take profit price, and the other is for the stop loss price.

Both of them need to be the bridge for human-computer interaction.

The names of the two variable for each position might be in this form:

"position_id"_takeprofit,
"position_id"_stoploss.

After the order is closed, I need these two variables for the position to be deleted at once.

Could you please give me some suggestion?

Thank you!


 
 Post subject: Re: Is there any function module in JForex client platform similar to Global Variable in MT4? Post rating: 0   Post Posted: Thu 06 Sep, 2012, 09:16 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please provide a more formal description of the algorithm.


 
 Post subject: Re: Is there any function module in JForex client platform similar to Global Variable in MT4? Post rating: 0   Post Posted: Thu 06 Sep, 2012, 09:29 

User rating: 0
Joined: Thu 16 Aug, 2012, 03:29
Posts: 26
I want to create two variables for each new order submitted successfully.

Suppose a new order is submitted and its position ID is 41425498.

I want the program to create two variables and their names are "41425498_tp" and "41425498_sl" separately and immediately.

The user could get access to these two variables and change their values, similar to the way that the variables created by @configure notation.

The program always takes the values of the two variables that the user input as the take profit price and stop loss price for the position 41425498 separately.

Whenever the position gets the either price, the position closes at once, of course.

And at the time the position closes, the program deletes the two variables.

That is my logic.

Please help me out.

Thank you very much!


 
 Post subject: Re: Is there any function module in JForex client platform similar to Global Variable in MT4? Post rating: 0   Post Posted: Thu 06 Sep, 2012, 09:43 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
How does that differ from creating an order with SL and TP and the user modifying SL and TP levels manually on the chart?


 
 Post subject: Re: Is there any function module in JForex client platform similar to Global Variable in MT4? Post rating: 0   Post Posted: Thu 06 Sep, 2012, 09:52 

User rating: 0
Joined: Thu 16 Aug, 2012, 03:29
Posts: 26
Oh, Expert,

It is just one simple example for us to discuss the issue.

I might need the program to create special variables for each position and the user could control the values of these variables and then control the trading patterns of the program.

Please help me out.

Thank you so much!


 
The Best Answer  Post subject: Re: Is there any function module in JForex client platform similar to Global Variable in MT4? Post rating: 0   Post Posted: Thu 06 Sep, 2012, 13:04 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Consider putting all active orders in an editable table, see example here:
https://www.dukascopy.com/wiki/#Order_update_table


 

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