Dukascopy
 
 
Wiki JStore Search Login

Is it possible to create a memory variable in Jforex?
 Post subject: Is it possible to create a memory variable in Jforex? Post rating: 0   Post Posted: Tue 13 Jan, 2015, 11:46 
User avatar

User rating: 0
Joined: Tue 13 Jan, 2015, 11:40
Posts: 6
Location: Italy, Cagliari
Hi all! I'm just starting to work with Jforex.

Here is my question: is there any strument in Jforex that permit to assign an initial value to a parameter?

I will explain better with an example: Imagine to have the following simple algoritm: If the "last trade event" is SELL, than ... else ...
But "last trade event" is an only read variable and at the begining, has no value.
So, I have to make a block that discern the initial situation when "last trade event" have no value from no initial situation when "last trade event" have a value due to an existing last position.

My questiotn is: how to implement the "If block" that choose the this flow? Thank you in advance.

In my opinion, the solution is to have a "memory variable" which is not affected by a "On Candle" start point.
I already have tried an IF block with "All Positions", another read only variable which have null for initial value, but this variable don't work because seems to count only pendings and open positions but not the closed positions. (I deduce this because the variable's value oscillate from 0 to 1).
I think that an internal loop is a good solution, I have to try it, but I wish to know if it is the only one.

Thanks in advance.


 
 Post subject: Re: Is it possible to create a memory variable in Jforex? Post rating: 0   Post Posted: Tue 13 Jan, 2015, 13:58 
Visual JForex expert at Dukascopy
User avatar

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

According to my understanding, you are looking to identify whether a variable gets attributed with a given value before using it. This is basically possible, if we use your example based on trade event it will look like this:

Image

the IF block used with "NoValue" variable will filter out any flow without data.
Hope this help


Attachments:
Trade event.JPG [184.05 KiB]
Downloaded 446 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: Is it possible to create a memory variable in Jforex? Post rating: 0   Post Posted: Fri 16 Jan, 2015, 11:53 
User avatar

User rating: 0
Joined: Tue 13 Jan, 2015, 11:40
Posts: 6
Location: Italy, Cagliari
Hi! Thank you very much Amine!
The solution was simple, I thought that the variable didn't exist while the algoritm assign it a value for the first time...
I haven't already try your solution but I thinks it will be all ok ;)


 

Jump to:  

  © 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