Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

trader273

How to Pass Variables into Indicators

Recommended Posts

Language: Easy language via OEC

Idea: How to determine future levels of an indicator using fixed range charts

 

Had an idea and thinking it would be relatively simple, but turns out not to be. Using an indicator, I will use RSI as an example, how to determine what price in the future will do to rsi. This idea works because of the range bars being fixed.

example: 4 Tick Range setting on the es. Trader knows what price the current bar will complete, and from there can see at what price the next bars will complete. So, say current bar has a high of 1205 and a low of 1204.50 ( 2 ticks, so 2 remain to complete the bar and another tick to start new bar). So as it stands, the bar will complete either at 1205.50 (needing 1205.75 to start a new bar) or 1204 (1203.75 to start new bar)

 

So from there, one could "know" what prices future bars will be closing at. Of course this will change when the bar makes a new high or low, so they really arent predicting anything. Just simple math.

 

The problem I have is passing that future level into RSI.

 

r=absvalue(high-low);
rem=range_setting-(r/mintick);
buy=High+(rem*mintick)+mintick;

 

That is how I define when the bar will complete. ( this one is used for completed up bar). It works fine and plots as it should.

 

RSIH= RSI (Close, RSI_Length);

 

So the RSI code is presumably looking for High,Low,Open,Close. If I pass my variable into the "close" in the code, it does nothing. That is just the first problem.

 

I need to compare what the rsi could be vs what it is in the previous bars. I tried something like:

If lastbaronchart then
CC=Buy else
CC-Close

 

I would use "CC" instead of "Close in the code, so it would look like this:

RSIH= RSI (CC, RSI_Length);

 

But that did little to nothing. So I am stumped here, I'm pretty sure something like this is possible, but I am out of ideas.

 

Any help is much appreciated.

Share this post


Link to post
Share on other sites

HI trader237,

 

I can two mistakes in the following lines..

 

If lastbaronchart then
CC=Buy else
CC-Close

 

First one:- The word Buy. Buy is an reserved word of Tradestation and it can be only is used in strategies to Buy the stock.

 

Second:-

else

CC-Close

It should be like this:-

 

If lastbaronchart then 
CC= Buy1 
else
CC = CC- close; 

 

EasyTrader_I

Share this post


Link to post
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.
Note: Your post will require moderator approval before it will be visible.

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...

Important Information

By using this site, you agree to our Terms of Use.