RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        


««12

FOREX Expand / Collapse
Message
Posted 1/18/2008 16:49:40 Post #4358
 

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being
Any thoughts?

I think it would help me tremendously if you could describe:

How exactly do you look up an exchange rate?
What "Exchange" do you use for this?


www.finantic.de
Our Trading System at C2: Topaz
Posted 1/18/2008 17:25:57 Post #4364
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
The exchange doesn't affect which symbol it chooses.  My guess is it affected you because when you changed the exchange it meant the symbol was now pointing at different data.

When you start a backtest with symbols that need an exchange rate, RightEdge looks through the symbols in your watchlist to find one that can provide the needed exchange rate.  It looks at all the symbols you have set up, not just the ones you have checked.  It doesn't look at the exchange, it just looks that the asset type is forex and that the base and counter currency combined will give you the exchange rate you need.  Now, you may have multiple symbols set up that match.  If it finds more than one match, it will try to select the "best" one based on the frequency.

The current logic to decide whether a frequency is better is this code:

bool bBetter = false;

if (newFreq == BarFrequency &&

      curFreq != BarFrequency)

{

      bBetter = true;

}

else if (newFreq > BarFrequency &&

            curFreq < BarFrequency)

{

      bBetter = true;

}

else if (newFreq < BarFrequency &&

   curFreq < BarFrequency)

{

      int newDiff = BarFrequency - newFreq;

      int curDiff = BarFrequency - curFreq;

      if (newDiff < curDiff)

      {

            bBetter = true;

      }

}

BarFrequency is the frequency of the symbols used in your system.  If bBetter is set to true, that means it considered newFreq a better match than curFreq.

Hopefully this makes some sense and helps.

Thanks,
Daniel

Posted 1/21/2008 16:18:41 Post #4412
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
Alright!
I got it , that's probably why I'm having MAJOR MAJOR performance hangs , lags etc...

I'm setting up symbols as follows :

EURUSD :

I just enter EUR , and place USD as currency..It then looks like EUR/USD ..If i just enter EUR/USD , and i put currency is USD , it will make EUR/USD/USD..


Is there a fix for this?
Should i just enter symbols as EURUSD , or EUR (and put USD as currency) and symbol will become EURUSD..

Then for EURCHF : Enter EUR , and currency is CHF ..Which makes EUR/CHF..

Is that why it hangs , etc?

FXMC
Posted 1/22/2008 01:25:46 Post #4415
 

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being
No, thats why it works. You did it correctly.
RE *displays* a FOREX Pair as EUR/USD when internally it is EUR traded in USD.
When it comes to sending an order to a broker or realtime data feed this symbol description is translated into the correct contract description, for example EUR.USD for IB which is Underlying=EUR, Currency=USD.


www.finantic.de
Our Trading System at C2: Topaz
Posted 1/22/2008 04:56:37 Post #4416
 

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being
For simplicities sake lets assume no margin and an exchange rate of
1 GBP for 2 USD and
1 CAD for 1 USD.

I selected a position size of $100k. (Which means for me that each single position should have a worth of $100k, similar rules for "percentage of available equity")

If I open an USD.CAD position I get Canadian Dollars and my position is worth about $100k.

But if I open an GPB.USD Position, I get 100,000 GBP with a net worth of $200k.
This is not what I intended!

Does RE urge me to do the exchange rate calculation inside my strategy and open a position of 50,000 Shares if I want a GBP position of $100k?
And if so, what is the best way to get exchange rates form within a script?

Any ideas?


www.finantic.de
Our Trading System at C2: Topaz
Posted 1/28/2008 03:46:50 Post #4459
 

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being
Any ideas?


www.finantic.de
Our Trading System at C2: Topaz
Posted 1/28/2008 20:03:38 Post #4474
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
Looking at our position sizing code, it does not account for forex or foreign currency symbols.  I have added bug 1207 for this.

In the meantime, you can use the SystemData.AccountInfo object to get the current exchange rate, and size the position manually.  The following line gets the (Ask) conversion rate from GBP to USB (which should be close to 2):

double exchangeRate = SystemData.AccountInfo.GetConversionRate(CurrencyType.GBP, CurrencyType.USD, QuoteType.Ask);

Thanks,
Daniel

Posted 2/11/2008 13:00:21 Post #4568
 

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being
I have some more trouble with a forex system.
In the graphic attached you see RE's position list for a forex 5-Min sytem.

First, the number of decimal places does not match the info set in a system's properties.

Second, the trade highlighted (EUR/JPY) clearly made some profit. (0.04 per "share" on 822842 shares) but the P/L column and Running Profits column are 0.0 for all trades of this system.

???

Let me know if you need data and/or the script to reproduce this.


www.finantic.de
Our Trading System at C2: Topaz
Posted 2/11/2008 14:55:20 Post #4569
 

DeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloperDeveloper
> First, the number of decimal places does not match the info set in a system's properties.

Do you mean the symbol's properties?  I don't think there is a system-level decimal places setting.  The P&L columns currently always use 2 decimal places, because they are in the account currency, not the symbol currency.

I don't know why the profit is showing as zero.  What does your symbol setup look like?  It also wouldn't hurt if you want to send us your system and data.

Thanks,
Daniel

Posted 2/12/2008 04:07:53 Post #4570
 

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being
I think thois was mostly false alarm and/or "pilot error":

First: The number of decimal places form "Symbol Information" are used. It helps if one uses the corect Watchlist-Folder for backtesting. (I entered the correct decimal places in one folder and used another for my testing )

As a side-note: I thought "Symol Information" is used across watchlists for the same symbol? Or to put it in another way: Could you provide a simple way to edit "Symbol Properties" for a set of symbols, i.e I do not want to open tens of dialogs to change "Exchange" or "Margin"...

Second: The profit was calculated as 0.0 because Margin was set to 0.0

I think RE should either treat a margin of 0.0 (default) as "1.0" or issue a warning if it encounters a margin setting of 0.0...


www.finantic.de
Our Trading System at C2: Topaz
« Prev Topic | Next Topic »

««12

Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: billb, young, dplaisted

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 6:18pm

2005-2007 © RightEdge Systems