Use custom indicator in a strategy

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Use custom indicator in a strategy

Postby ilnefopas » Fri Nov 09, 2018 10:05 am

Hi guys,

I have this indicator attached coming from fxcodebase.
I'd like to use it in a strategy, meaning :

- calling it
- intializing it
- retrieve the value of HIS once a 5mn minute candle is closed.

But I have no idea how to do that.
Can you help ?

Thanks.
Attachments
ZeroLagMACD.lua
(4.47 KiB) Downloaded 434 times
ilnefopas
 
Posts: 26
Joined: Mon Dec 28, 2015 12:51 pm

Re: Use custom indicator in a strategy

Postby Apprentice » Sat Nov 10, 2018 7:21 am

First, I am aware that this is probably not the simplest example possible.
It is one of the possible implementations.
viewtopic.php?f=31&t=66908

If you are to learn SDK, familiarize yourself with the Lua programming language.
Probably the best place to start is.
http://www.lua.org

Here you can download a book.
Programming in Lua
by Roberto Ierusalimschy

Also download and install, our SDK Lua extension.
Editor and Debugger are included, and also an extensive Help.
http://fxcodebase.com/documentation.php

Also, I'm holding private webinars on the topics,
with a focus on programming for Marketscope / TS 2 trading platform.
if you will be interested contact me via email.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Use custom indicator in a strategy

Postby ilnefopas » Thu Nov 15, 2018 4:37 am

Ok now I need just one more tip...for now :)
I'm trying to run ZeroLagMACD Strategy.lua in Indicore 3.
Of course ZeroLagMACD Strategy.lua needs indicator ZeroLagMACD.lua to do its job and I do not know how to tell Indicore where it is. :-(
ilnefopas
 
Posts: 26
Joined: Mon Dec 28, 2015 12:51 pm

Re: Use custom indicator in a strategy

Postby ilnefopas » Thu Nov 15, 2018 4:38 am

Ok forget my last post.
I added indicator ZeroLagMACD.lua to the project and it's working.
Thanks again.
ilnefopas
 
Posts: 26
Joined: Mon Dec 28, 2015 12:51 pm

Re: Use custom indicator in a strategy

Postby ilnefopas » Sun Nov 18, 2018 4:48 am

Another question Apprentice...

Still in my strategy, I want to use the "regular" DMI indicator coming with TSII.
The problem I have is that I cannot find the code of this indicator and thus I do not know how to call DI+, DI-, ADX,...in my strategy.
How can I know the name of the DI+, DI-,....variables and the way they are used in the indicator ?
With the same idea, I cannot initialize the indicator.

Thanks.
ilnefopas
 
Posts: 26
Joined: Mon Dec 28, 2015 12:51 pm

Re: Use custom indicator in a strategy

Postby Apprentice » Sun Nov 18, 2018 5:25 am

If you open DMI indicator in the editor you will see that Names are "DIP" and "DIM".
--In update
--if you indicator call name is "indicator"
Indicator:update(mode);

--You will have Indicator.DIP[period] and Indicator.DIM[period]
-- also u can use
--Indicator:getStream(0); -- 1. Stream or "DIP"
--Indicator:getStream(1); -- 2. Stream or "DIM"

My suggestion is to read the SDK help from cover to cover before any further code writing.
You will find a lot of similar examples in it.
All this and more is described there.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Use custom indicator in a strategy

Postby ilnefopas » Sun Nov 18, 2018 7:14 pm

Thanks
ilnefopas
 
Posts: 26
Joined: Mon Dec 28, 2015 12:51 pm


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: captainjacksparrow, Google [Bot] and 13 guests