Jump to content
Medved Trader Forums

Scan Paintbar advanced mode questions


Recommended Posts

Can you share an example external file and how it used within a scan? What type of code or languages are compatible?

Including External Code

#include

This allows you to include code from an external file (specified following the #include).
 
Example:   #include c:\temp\mylibrary.code

 

Link to comment
Share on other sites

Basically, any snippet of the C# code that would work in advanced paintbar could be isolated into a separate file and included via the #include.

The #include is there so that you can have a library of functions you use and #include it in paintbars without repeatedly inserting the same code in every paintbar where it would be used.

Link to comment
Share on other sites

Hello Mike, thanks for this info, I'll try it out. I assume if there are any variables in external script requiring access to data will have to be added to internal paintbar code?

The other question I have is about scan chart parameters such as frequency can be read from within a scan?

I want to append this to naming SetInterVar() then call by GetInterVar() elsewhere based on frequency selected.

image.png.0350327b9330e11b64e43c8bc7c63b74.png

 
Edited by Kasper
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Hello Mike,

I am now using Set/GetInterVar between MT and my WS-API app to exchange data. Can you tell me if it should work like data subscription? Within MT GetIntervar can stream between two scans. Do I need to do something on app for something similar?

Also, is there a way to throttle a scan, say one scan pass over all symbols then wait n seconds before going again. Or if frequency on portfolio is set to 5 minutes thena rule to run scan every (frequency * 0.25) minutes.

Thank you.

Link to comment
Share on other sites

1. No, intervars don't stream. You have to get it every time you want an updated value. It is very light in terms of processing, so poll it as much as you want. Make sure you figure out what intervar you want - a symbol-specific one or a "global" one.

2. No need to throttle scans. You run the scan, it initializes (possibly slowly if there are a lot of backfills) then just runs on every update. Again, unless it is written really inefficiently (like huge loops for each run) it is pretty light, so no need to just run it every X minutes. But - if you really would like to, there is code that you can put in the scan that will only run once the candle is finished.  Just check the IsNewCandle variable, and if true, run the calculations on the previous candle (which at that point would be finished).
 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...