Learning RTL syntax, any response highly welcomed

Login or Register

Please login or register in order to view and post in the Forum.

23 posts / 0 new
Last post
joshdawson
Last seen: 1 year 2 months ago
Joined: 04/14/2015 - 12:25
Learning RTL syntax, any response highly welcomed

When creating a back test. How do I set the "rule" to exit at the desired target.

E.G, Hi > HI.1 , how do I have the system exit on the cross of the previous hi?

0
william-linn
Last seen: 13 hours 32 min ago
Joined: 06/03/2011 - 00:00
RTL Signals and Trading System Rules

Each rule in a trading system has a signal and an associated action. When you create a new trading system you see a list of your trading signal names and a list of the actions. So to create  a rule you first select the signal name, then select the action you want to occur when that signal fires and click the Add Rule button. The new rule will then appear in the Trading Rules list. In this example, I will assume you have already setup a rule with some signal for entering the market with action BUY. Your exit signal, HI > HI.1 I assume is saved with a name like Break Above High. So, you select the signal name Break Above High, pick SELL as the action and click the Add Rule button.

joshdawson
Last seen: 1 year 2 months ago
Joined: 04/14/2015 - 12:25
Hey Mr. Linn, I hope you are

Hey Mr. Linn, I hope you are having a great week so far!!!! Version 14 updates look, killer!
15M TF, SESSION 2 (09:30-16:15)
Rule 1: POS = 1 AND CL > OP ----> ACTION: bUY TO OPEN A POSITION---> RULE PRICE = OPEN

RULE 2: #This is where it falls apart#, POS = 2 AND HI >= HI.1 ---->SELL 1 AT CLOSE PRICE. ---RULE PRICE = CLOSE

That is where I am confused because I don't want the "Rule Price" to be the "close" ( I understand there is a drop-down box which gives multiple selections, but I am not sure what to use) of the 2nd 15min bar, I want the system to exit the trade when price crosses the high of the first 15-minute bar. I have tried multiple things until I had to take a break from frustration and come back with fresh eyes.

When I write the same code and send it to "signal maker" it works perfectly. But I am falling flat on my face in the backtesting.

To recap, the question is- How do you make a system exit when it crosses a parameter such as previous high?

cpayne
Last seen: 1 year 7 months ago
Joined: 03/30/2009 - 00:00
Use a V#

So with...

HI > HI.1

and you'd like to exit (or enter) at the time/price it crosses HI.1....just change syntax to...

HI > HI.1 AND SET(V#10, HI.1)

and then set the exit/entry price to V#10...

or, if you want to consider a tick of slippage...actually, if you're requiring HI to exceed HI.1 you need to add another tick to HI.1 anyway...

HI > HI.1 AND SET(V#10, HI.1 + TINC)

joshdawson
Last seen: 1 year 2 months ago
Joined: 04/14/2015 - 12:25
Follow up:

Hey Chad,
I have been using the Set V#10 as you have instructed!!! I have also gotten really familiar with POS and MPD, I didn't know IRT had some of those features.

I am trying to do this study now and it's not working. I am not sure what I am doing wrong.
eNTRY = ROC < 94 AND SET(V#10,ROC)
STOPLOSS = ROC < 90 AND SET(V#11,ROC)
TARGET = ROC > 100 AND SET(V#12,ROC)

Is this the correct way to set indications within variables?
I am trying to backtest and use the V#10 as the cross.

OR did I do an epic dive bomb?
Thanks.

cpayne
Last seen: 1 year 7 months ago
Joined: 03/30/2009 - 00:00
Entry

Let's just focus on your entry signal for now...

ROC < 94 AND SET(V#10,ROC)

I assume you want to enter when ROC moves below 94....which would be..

ROC < 94 AND ROC.1 >= 94

So looking for it to have been above or equal to 94 on previous bar.

I'm not sure why you're setting V#10 to ROC, but I often use V#10 as my entry price.  You might not need to do that in this case, as you might just be getting out at Close price of bar.

Then your stoploss signal might just be....

ROC < 90

(again getting out at close when that bar closes with ROC < 90)

and target..

ROC > 100

 

joshdawson
Last seen: 1 year 2 months ago
Joined: 04/14/2015 - 12:25
Hey Chad, I hope you are

Hey Chad, I hope you are staying cool down in GA, in WV it's like a freaking jungle of endless sweating. Especially on the tractor.
I'm stuck again. Shocker I know, but don't spit your drink out from the surprise.

I created a signal
op > op.1 and I then imported that into Sig Stats, I used the sum of all signals which gave me 161
op> op.1 and hi > hi.1 imported that into Sig Stats, I used the sum of all signals which gave me 128
128 / 161 * 100 = 79%

Is there a way in which I can have IRT calculate the stats for me, that way I can import different symbols and get the probability vs calculating it by hand?

So to recap
I took the sum of all signals for the first signal (op > op.1)to isolate the number of times we open higher.
I took the sum of all signals for the second signal (op > op.1 and hi > hi.1) to isolate the times we open higher and broke higher.

I broke out a calculator from collage and crunched the numbers to get 79%
However, is there a way to build a custom indication or a signal to automatically calculate the % for me?

Thank you, sir.
I

cpayne
Last seen: 1 year 7 months ago
Joined: 03/30/2009 - 00:00
Stats as Percentage

In Signal Statistics, for the OP > OP.1 signal, you'd set it up to record value into C#1 as seen below...

Then in the OP > OP.1 AND HI > HI.1 Signal Statistics, set the Text Label to...

HI OP UP//C#1

By adding that //C#1 to the end, it will compute the value as a percentage of C#1 and display it in the Text Label...

Also set the format of both Signal Statistics to 99 (whole numbers) in this case for formatting the output.

Then just add an info box to the same pane, setup like this...

While will result in this display...

In the chart below.  Here is the definition: https://www.linnsoft.com/charts/openhighupstats-esu0

 

joshdawson
Last seen: 1 year 2 months ago
Joined: 04/14/2015 - 12:25
Thank you!!!!

Thank you!!!!

joshdawson
Last seen: 1 year 2 months ago
Joined: 04/14/2015 - 12:25
Storing HVN

***Delete***

cpayne
Last seen: 1 year 7 months ago
Joined: 03/30/2009 - 00:00
Closest HVN

You can use the PROF token in a custom indicator or signal and set the result to "Closerst HVN".  Should give you what you're after.

Pages