I would like to share something with the community that my team came up with a couple of years ago and that I've been using a lot over the past month as I develop strategies and studies in EasyLanguage. I use Notepad++ in my daily life outside of trading for developing a ton of code in a number of different languages.
I often like to code outside the TradeStation Development Environment, for a number of reasons. The main reason is that I suffered a major crash of TradeStation and lost half day's work. I have a couple of version control mechanisms in place that constantly save my file changes in Notepad++, so I never lose my work.
How to install:
Download the XML file attached to this forum post: EasyLanguage.xml
Open Notepad++
From the menu, click: Language > Define your language...
You will see the User Defined Language dialog box
Click Import
Locate the XML file you downloaded in Step 1
Click Open
You should see: Import successful.
How to use:
In the User Defined Language dialog box, I have defined the file extension esl for EasyLanguage. This means every time I open or save a file with that extension, the context highlighting will be applied. You can change this to whatever file extension you may prefer.
To apply the language immediately to an unsaved document,
From the menu, click: Language > EasyLanguage. It's that easy!
This is what it looks like in Notepad++:
How to modify:
From the menu, click: Language > Define your language...
Select EasyLanguage, as shown here:
Change the stylers as you like: font, colors, etc. (you're on your own there)
Add your own custom function names to the styler lists, if desired/needed
Changes are saved automatically. I like to keep a backup, so I always export my language definition for safekeeping.
Please note, you cannot modify ELD files in Notepad++, as they are binary. I mean, you could modify them, but not usefully.
Known issue:
The keyword arrays does not seem to appear in color as it should.
I do not use MultiCharts, so I cannot say how good this is with the EasyLanguage code you folks use. I only use TradeStation. Your mileage my vary.
I hope you find this useful. Please let me know if you find any issues with it, or feel free to upload and share your modifications.
~vmodus
The following 21 users say Thank You to vmodus for this post:
This is awesome, thank you so much for the great share.
If possible I have a little feature request. Since the usual TS IDE as well as NPP usually defaulted to white background for development, it will be great that if we can make the IDE into dark mode (or dark color background, better for the eyes).
Is there any chance we can do a slight mod to the XML so that the it will work with dark background? (or by any chance you also use sublime text and may have EasyLanguage addon for Sublime?)
Cheers!
rc76
The following user says Thank You to rc76 for this post:
I'm glad this is useful for you. Hmmmmm...... dark background. Maybe you can check out these themes: https://cyberspacehawk.com/notepaddark-theme/ I have not used a theme before, so I don't know how the language will look. By coincidence, I just switched my PC over to dark theme a few days ago, so this is a very timely question.
I'm kind of old school..... my first computer black screen with amber characters and just block graphics, so I like the dark theme.
Personally, I'm not happy with my comment font, but I've been too lazy to fiddle with it.
I don't use sublime, but maybe we'll give a swing when I have some free time. I will let you know what I come up with for the Notepad++.
FYI....I just remembered there was a thread on the TradeStation community forums where someone did something similar. You might want to search "Notepad++" over there.
I didn't knew one could add languages to Notepad++, generally I just use Notepad on my system to do modifications and editing too, it works much better than default Pine editing window, so I'm curious if Pine could be added to the Notepad ++ too.
This is good idea, thank you
The following user says Thank You to LastDino for this post:
Thank you for that, I do indeed have list as Pine has documentations available, so its just matter of copy pasting from functions area. I don't think I can do SQL thing though, will look up tutorials online on this. Thanks a lot
Do you mean outlining? Toolbox I don't use outlining, but it is useful. Right now, I think only the commenting collapses. Maybe I can integrate this into future versions of this language.
You're welcome. You can always import the EasyLanguage xml into Notepad++, save it with a new name, then replace the EasyLanguage keywords with the Pine keywords. Fiddle with the Comments and Operators/Delimiters and you will be on your way.
You can have different styles for different types of keywords, as shown here:
You can also associate file extensions, so I use .esl since it isn't used for anything else on my PC.
I hope this helps!
~vmodus
Enjoy everything!
The following user says Thank You to vmodus for this post:
Thanks for the feedback. I think I would need to add this to a theme, or maybe I could just hack the XML file. I was looking at the Dracula theme and I think it would not be too difficult. I may do it once my list of projects is whittled down to something manageable.
I will post updates on this thread. Just don't hold your breath....it may be a while.
Yeah, not sure about that, but I'll look into it when I try to do a dark theme. I know there is 'auto-indent' as an option in Preferences, but language or keyword specific....not sure about.
Just FYI, if you get the following error when applying the language:
An exception occurred due to plugin: DSpellCheck.dll
Exception reason: vector<T> too long
...just update the DSpellCheck.dll plugin via Plugins menu --> Plugin admin...
Apparently, plugins don't get updated along with the main program. I removed the Language, readded, then applied, and didn't receive the error.
I will take a look at this. I'm working on the dark theme in the next few weeks, so maybe I will look at this at the same time. Can you point me in the right direction with a language in NPP that does multi-line comments as you described?
I don't think the particular language is the issue. It's just an issue with NPP. If you create a completely new language and use an open bracket as the opening of the block comment and the close bracket as the closing of the block comment, it still does the same thing. Take this block for example:
This was a nested ternary operation from a PineScript indicator I converted to if-else to help me understand it so I could convert to EasyLanguage. I just copied and pasted into the code I already had to make it convenient to look at. If you copy and paste into TDE, it's commented out, but not in NPP. Not completely anyway. Some is, some isn't. It's not a huge deal. I can always use line comments since it's not terribly difficult to read.
The following 2 users say Thank You to sgjohnson for this post:
Thanks. I'm wondering if those characters can be escaped somehow, if you know what I mean. I'm not sure how flexible the language editor is, but I will take a look at it anyhow.
I'll post any updates on this thread.
~vmodus
Enjoy everything!
The following user says Thank You to vmodus for this post:
Actually, line comments don't seem to work either. NPP sees a close bracket as ending the comment regardless if it's preceded by a line comment on the same line. Weird.