Custom Windows & buttons using SDK and lua?

Section for discussions related to indicators, use of indicators, and building of trading stategies using indicators.

Moderator: admin

Custom Windows & buttons using SDK and lua?

Postby ________Sid » Thu Mar 14, 2013 11:12 am

Hello - I am new to Marketscope and lua programming but I have managed to adapt some simple indicators for my own use in demo trading that have been posted on this forum. Thank you.

I would like to ask if it's possible to develop popup windows and custom buttons using sdk and lua in a similar way to using java api with some other trading platforms, or would I have to program in C++ with the trading api to do this?

Thanks

Sid
________Sid
 
Posts: 2
Joined: Thu Mar 14, 2013 10:59 am

Re: Custom Windows & buttons using SDK and lua?

Postby Ekaterina » Fri Mar 15, 2013 7:03 am

Hi Sid,

I would like to ask if it's possible to develop popup windows and custom buttons using sdk and lua

No, it is not possible. The maximum thing to do is: addCommand

or would I have to program in C++ with the trading api to do this?

Yes, to develop strategy with your own interface you should use Forex Connect.

Best regards,
Ekaterina
Ekaterina
 

Re: Custom Windows & buttons using SDK and lua?

Postby ________Sid » Thu Mar 21, 2013 6:39 am

Hi Ekaterina
Thanks for your reply.
I'm trying to put together a strategy that will work on a particular currency pair chart - let's say EUR/USD, but will take information on my account currency/counter currency, in this case GBP/USD
to size a position.
The question is how to do this. Should I subscribe to GBP/USD in Marketscope then use:

core.host:execute("subscribeTradeEvents", cookie, "offers");

in the prepare function?

But then how to get bid price for GBP/USD in code?
I can use:
OfferID = core.host:findTable("offers"):find("Instrument", "GBP/USD").OfferID;
in update() function to get the GBP/USD instrument but how do I get the bid price from OfferID?

Sorry if this seems basic but learning new language is really quite a challenge.

Thanks

Sid
________Sid
 
Posts: 2
Joined: Thu Mar 14, 2013 10:59 am

Re: Custom Windows & buttons using SDK and lua?

Postby Ekaterina » Sun Mar 24, 2013 4:03 pm

Hi Sid,

If you want just to receive a current price of another instrument, you can do the following:

Code: Select all
local offer = core.host:findTable("offers"):find("Instrument", "GBP/USD");
local bid = offer.Bid;


In this case you do not need to do any subscriptions, like subscribeTradeEvents.

Best regards,
Ekaterina
Ekaterina
 


Return to Discussions

Who is online

Users browsing this forum: No registered users and 4 guests