Carmackjw 12 posts msg #157862 - Ignore Carmackjw modified |
10/13/2021 10:08:34 AM
I created a filter using two of my favorite indicators. Rsi(10) and Williams %R (10). I have tied the indicators together as you can see in the below script. (Basically a combined score).
Is there any way to backtest entry and exits based on the following criteria:
Buy when total column is below 50 for any of the various etfs in the symlist. ****** AND ONLY buy when SPY total is below 100. Sell when total column is 150 or higher.
ALSO, any bells and whistle adds or suggestions are appreciated
Here is the setup:
symlist(tqqq,sqqq,spy,vcr,vdc,vde,vfh,vht,vis,vgt,vaw,vnq,vox,vpu,svxy)
add column Williams %R(10)
add column rsi(10)
add column rsi(2)
set{combined1,100 + williams %R(10)}
set{combined2,rsi(10)}
set{total, combined1 + combined2}
add column total
sort column 8 ascending
|
nibor100 1,031 posts msg #157863 - Ignore nibor100 |
10/13/2021 10:37:35 AM
Is "target column" the same as "total column" in your filter?
Thanks,
Ed S.
|
Carmackjw 12 posts msg #157865 - Ignore Carmackjw |
10/13/2021 11:02:27 AM
Yes, sorry, mistype
|
Carmackjw 12 posts msg #157866 - Ignore Carmackjw modified |
10/13/2021 11:30:00 AM
I’d like to add this in as an extra visual, but I’m messing it up somehow:
set{buy, count(total < 50,1)}
set{sell, count(total > 150,1)}
SET{TRIGGER,50}
draw buy on plot
draw sell on plot
I’m trying to get it to show when it is below 50 and above 150
Not sure if trigger is set right or not; or what that’s for
|
nibor100 1,031 posts msg #157867 - Ignore nibor100 |
10/13/2021 12:03:56 PM
a. Your new Buy and Sell variables are showing up on my charts when I run the combined filters but since their values can only be 0 or 1 they are showing up as rows of colored boxes below the Volume plot. To draw them on the actual Price chart you have to add "price" after the word 'plot' but since they are 0s and 1s they will likely mess up the chart display scale.
b. I'm confused by the end of your post regarding Trigger
"or what's that for"???
what did you want trigger to be for?
Thanks,
Ed S.
|
nibor100 1,031 posts msg #157868 - Ignore nibor100 |
10/13/2021 12:13:06 PM
Regarding your backtest request, type the following into the search box and read the post by Cegis to get some ideas of what you can accomplish:
"Technique: Calc your own returns - for any period"
Ed S.
|