Search | User Listing Vidsite | Calendars | Quotes
Home Page ->  OLang, OScript & OPilot -> SDK Discussions -> View ThreadLogon (or Register, or Join TradeTight)

You are logged in as a limited-access Guest.To join TradeTight, first read the info in the Organization & Content room, then click the link above. 

1 Timothy 6:6-7 (NKJV) ... Now godliness with contentment is great gain. For we brought nothing into this world, and it is certain we can carry nothing out.


How to create a "non-plot" SDK Indicator
Jump to page : 1
Now viewing page 1 [50 msgs/pg]
Jump to room :
JimThorpe
Posted 2/13/2015 11:44 PM (#6135)
Subject: How to create a "non-plot" SDK Indicator



Friend

Posts: 26
25
Location:
USA: GA, Suwanee
Hi Folks,

Can anybody advise if the SDK can be used to create a function call? That is, I do not want to plot anything at all, but I would like to calculate a numeric value in an SDK plugin and then return that value to an OLang indicator when called, something like this where the GetMyCalcValue would be the SDK plugin call:

#Indicator
Dim MyCalcValue as Single
MyCalcValue = GetMyCalcValue()
Return MyCalcValue ' Return the value calculated by the indicator

When I try to call an SDK plugin as shown above, I get a compile error that "GetMyCalcValue is not declared. It may be inaccessible due to it's protection level".

I have the sample test indicator working just fine so this is not asking how to get the SDK working.

One thing I do find is there seems to be a "No Plot" Indicator type available in the SDK Indicator constructor as follows:

MyBase.InitializeIndicator(enuPlotType.enuPlotTypeNone)

However, I don't see how to set a "return" value... Again, not a price series or plot, just a numeric value (returned in a numeric array).

So I have two problems, one is the call and secondly no way to set the "return" value from within the SDK created plugin.

If anybody knows how to handle this, please advise!

Thank you kindly,

Jim Thorpe
Top of the page Bottom of the page
RobertNio
Posted 2/14/2015 9:13 AM (#6136 - in reply to #6135)
Subject: How to create a "non-plot" SDK Indicator


Friend

Posts: 11
0
Location:
CA: ,
You do NOT need the SDK ...

Here is what you could do:
__________________________________________

Create your OL indicator / system

Have it compile

Find the compiled file in the OT\VBA\TEMP ... something like <your indicatorname>.txt

Cut and past the content into a NEW OL page ... and modify it to your liking.

The DIRECTIVE "'#NATIVE ' This is native .Net code, and will not be parsed" does the trick.
__________________________________________

So you do NOT need the SDK to fiddle around with some VB code.

BTW, "MyBase.InitializeIndicator(enuPlotType.enuPlotTypeNone) " is used in the CONSTRUCTION of the class to initialize some parameters etc. the real function "oPlot.PlotPriceIndicator( ..." is used in your MAIN class for your VB Indicator .... oPlot being defined as "oPlot As CSystemPlotBase,"

Hope this helps.

Robert
Top of the page Bottom of the page
JimDean
Posted 2/14/2015 9:22 AM (#6137 - in reply to #6136)
Subject: How to create a "non-plot" SDK Indicator



Owner/Admin

Posts: 3925
2000100050010010010010025
Location:
USA: GA, Lawrenceville
Thanks Robert. JimT made this request on my behalf, so I know what the req'mts are.

In this case, we must use the SDK since the code must be in compiled DLL form, in order to guard its details since it will be distributed.

So, if you can assist with answering the question *for* the SDK environment, it would be much appreciated.

Task is simple: create an Indicator in SDK which returns a value to an OLang routine that calls it like any other N-supplied function. JimT stated that it was a data item not a dataseries ... afaik that is incorrect since OLang *expects* dataseries arrays for its variables. So, SDK routine looks like this:

Minimal shell initializations (would like to know min req'd to leave out fluff)
Calc special value (don't need help with this)
Return value (such that it can be "seen" in OT calls as would any other Indicator)

Thanks
Top of the page Bottom of the page
RobertNio
Posted 2/14/2015 9:57 AM (#6138 - in reply to #6135)
Subject: How to create a "non-plot" SDK Indicator


Friend

Posts: 11
0
Location:
CA: ,
Quick Q:

Pick what you want to do:

SYSTEM

or

INDICATOR

If you use the SDK as a DLL ... you will loose the connection to OL

The SDK will help you PLOT / CREATE SIGNALS / CREATE ENTRY FILTERS SIGNALS / CREATE STOPS <== These are the methods OT will let the DLL do

I am not familiar with OL to know if / how you can use an INDICATOR result (PLOTS / SIGNALS) for further processing.

I can send you a sample sniplet ... for you to use once you tell me which of the TWO (Sys / Ind) you want.

Robert

Top of the page Bottom of the page
JimDean
Posted 2/14/2015 10:13 AM (#6139 - in reply to #6138)
Subject: How to create a "non-plot" SDK Indicator



Owner/Admin

Posts: 3925
2000100050010010010010025
Location:
USA: GA, Lawrenceville
As stated earlier ... we need a DLL which acts like an INDICATOR. It needs a RETURN statement in it, so that the value it calculates is available to a calling routine. The routine needs to be written in the SDK simply so that it has access to some SDK environment information.

I am *very* familiar with OLang ... don't need help with that. Thanks.
Top of the page Bottom of the page
RobertNio
Posted 2/14/2015 3:14 PM (#6140 - in reply to #6135)
Subject: How to create a "non-plot" SDK Indicator


Friend

Posts: 11
0
Location:
CA: ,
Hi Jim,

sorry that I was not clear enough.

As far as konw OT can NOT call just an external DLL-Method and deliver the results back to you.

The ONLY work around for this, is to hand code the "GLUE" between the OL code and your custom DLL, ... in the way I described in my first reply.

Here is what the SDK can do ... :

Provide a set of PRE-DEFINED methods: to plot / create signals / create filter signals / create stop signals

There is NO way You can have OT find your DLL and call a custom function you created and return the results.

OT is ONLY able to call any of those PRE-DEFINED methods ... you can do everything INSIDE those methods ... but OT will want to see the results in a predetermined way ... so no real way to take the results and further process them.

There is NO-WAY I know off, to tell OT the name of your method inside the DLL and have OT then call it ... and further process a result array.

Q: in OL can you create an indicator ... based on another indicator ... if yes ... then this might do the "trick" ?

Attached is a snip-let ... to let you see yourself what you can / or can not do ...

Hope this made it clearer.

Robert



Edited by RobertNio 2/14/2015 3:22 PM

Attachments
Attachments DEMO 02-14-2015.txt (13KB - 8 downloads)
Top of the page Bottom of the page
JimThorpe
Posted 2/15/2015 12:37 PM (#6141 - in reply to #6140)
Subject: How to create a "non-plot" SDK Indicator



Friend

Posts: 26
25
Location:
USA: GA, Suwanee
Hi Robert,

Yes, we are rather out of luck with the SDK. What was really needed would be an SDK "function" that could be called from OL but as you have pointed out is not available.

This would make a great addition to SDK functionality should Nirvana decide at some point in the future to do some enhancement work in this area.

Thank you for the information.

Jim Thorpe
Top of the page Bottom of the page
RobertNio
Posted 2/15/2015 1:13 PM (#6142 - in reply to #6135)
Subject: How to create a "non-plot" SDK Indicator


Friend

Posts: 11
0
Location:
CA: ,
Just another thought ...

if you go through the trouble to make a DLL with the SDK ... why not just code EVERYTHING inside the DLL ... instead of just one element (Black-Box Math)

Whatever you can do in OL ... you can do with the SDK ...

Just go ahead and program your OL ... have a placeholder-dummy for your special calculation ... and then look at the pre-compiled output in the temp directory.

Take that and put it as the code for your DLL ... and write the special math in place of the placeholder.

This way you do not have to do too much coding ... rather leverage what OL does for you.

Its fairly straight forward ... if you are a little familiar with the SDK.

Robert

Top of the page Bottom of the page
JimThorpe
Posted 2/15/2015 1:42 PM (#6143 - in reply to #6142)
Subject: How to create a "non-plot" SDK Indicator



Friend

Posts: 26
25
Location:
USA: GA, Suwanee
Hi Robert,

I will have to ask Jim Dean about the solution you describe. That does sound like a possibility but I will have to ask Jim Dean if that solution will work for him.

Thank you,
Jim Thorpe
Top of the page Bottom of the page
Jump to page : 1
Now viewing page 1 [50 msgs/pg]
( E-mail a Link | Printer Version | Search Room )

Owner of site: Jim Dean -- Forum content is confidential, and may not be distributed without written permission.