Hide Plot from EasyLanguage/TradeStation

Hiding plot line from TradeStation Chart

(For indicator coders/programmers)

EasyLanguage is quite feature-rich giant, but sometimes you have to do some “tricks” to achieve quite simple things. While coding an indicator, in some cases/conditions, you might need that plot lines where not shown on a chart at all. Unfortunately, TradeStation/EasyLanguage might not help in a few specific cases, like discussed in this topic…

First step you should do (probably you have already noticed that option, but didnt use), is to turn off (uncheck) “Automaticall connection between plots”:

Doing that will avoid the last plot-ed bar to be connected to the next occurrence plot-bar with a line.
The next step is (what I have found so far) to show plot lines on specific conditions ( using PlotN command, where N is a natural number) and using NoPlot(N)  command, when we want to hide the line. For example:
If (close>Open) then Plot1(High, "hiii");
Else NoPlot(1);

Another “trick” could be to set the PLOT-COLOR to background color of chart:

 Plot1(High, "hiii");
 If (close>Open) then Setplotcolor(1, yellow)
 else                 Setplotcolor(1, GetBackgroundColor ); //or set any color, i.e. black

Typical Advices

Some coders may already know it, but some may not, that there exist several SHORTHANDs in EasyLanguage, like:

Iff(...)        //used to return NUMERIC value
IffLogic(...)   //used to return BOOLEAN value
IffString(...)  //used to return STRING value

So, in our case, we can just use:

Setplotcolor(1,      iff(condition, Yellow, GetBackgroundColor)      );  
           //we use "iff" because colors are numeric values

So, whenever condition¬†is not met, the plot will get Background color. I think it’s also useful trick in some cases, when you are unable to hide plot by traditional ways.

That’s all, I think it could have solved the problem.

//I do not know it helped you in your case or what problem you were facing, but at least, if you didnt know the shorthands, that could be worth to find that in this article. If there is something you want to add, feel free to comment.

Leave a Reply

Your email address will not be published. Required fields are marked *