help with some code writing

StrataSearch has many powerful features, with many techniques and approaches to explore. Here we discuss the things we've done, and the things we'd like to do.

help with some code writing

Postby 3daystrader » Thu Aug 13, 2015 5:15 pm

Hi Guys,

I am new here and I tried to understand with examples in help how to write the correct syntax but unfortunately I could not successfuly.
I would appreciate it very much if someone could give me some examples so that I could better understand the syntax.
For example:
1- Mi(mass index) (14) < 27
2- psar(parabolic sar) > close and psar < failed more then 5% last day
3- buy at same day at price close and exit after 3 days at open.

Thanks.
3daystrader
 
Posts: 4
Joined: Thu Aug 13, 2015 7:07 am

Re: help with some code writing

Postby Overload » Fri Aug 14, 2015 11:09 am

Writing code for users is more than we can really do for tech support, but I can at least direct you toward where you can get additional information.

I'd first recommend you follow the first few chapters in Tutorial #2 in the StrataSearch Help. These chapters will give you the basic information on creating Strategies in general, and how to run them and view the results.

After that, there is a chapter in the Help for Formulas. Browsing through that chapter will give you information on the current indicators you're looking for, and can be a good resource for additional indicators you might want to use in the future.

Hopefully this helps.

Pete
Overload
 
Posts: 2248
Joined: Wed Nov 30, 2005 12:14 pm

Re: help with some code writing

Postby 3daystrader » Sat Aug 15, 2015 2:44 pm

Thanks alot I will check it.
3daystrader
 
Posts: 4
Joined: Thu Aug 13, 2015 7:07 am

Re: help with some code writing

Postby mandelmus » Sun Aug 16, 2015 12:09 pm

If you describe the setup you are looking for, in detail, and post what you have so far, many of us would be happy to make suggestions to improve your code.
mandelmus
 
Posts: 141
Joined: Fri Dec 23, 2011 1:51 pm

Re: help with some code writing

Postby 3daystrader » Tue Aug 18, 2015 10:36 am

basic example :
I like to trade with stocks with price above 5$
and i tried this:
close > 5
received a error "invalid use of opreators: >5"
When i take a look in the help:
Comparisons
Comparisons are used to evaluate the values returned by two calculations. When a comparison proves true, the conditions of that portion of the entry and exit strings have been met. Consider the following statement:

close > 5
what is wrong?
3daystrader
 
Posts: 4
Joined: Thu Aug 13, 2015 7:07 am

Re: help with some code writing

Postby Overload » Tue Aug 18, 2015 2:16 pm

I am guessing that "close > 5" is not your entire entry string, but is a second rule in your entry string. Is that possible? If so, you need to use the AND statement between your trading rules. Here is an example:

This is NOT valid:

Code: Select all
rsi(14) < 35
close > 5

This IS valid:

Code: Select all
rsi(14) < 35 and
close > 5

Hopefully this helps.

Pete
Overload
 
Posts: 2248
Joined: Wed Nov 30, 2005 12:14 pm

Re: help with some code writing

Postby 3daystrader » Wed Aug 19, 2015 10:39 am

Thanks alot for your help,
You are correct, >5 is one of my criteria to selct stocks.
I missed the "and" now its OK.

psar(0.02, 0.20) > close and close > 5 and
Mi(14) < 26.5 and mov(v,3,s) > 300000

I like to add my filter average volume of last 3 days and last 30 days.
this is the correct? mov(v,3,s) > 300000 for the average of last 3 days?
and i like to use psar(0.02, 0.20) Falling all the way from upside to downside and the difference between the dots is more and more bigger.
can i add here some chart to be more clearly like symbol "PER" with Psar indicator ?

I this situataion i need to use variables?
I apologize in advance because i have now free 30-day trial and want to know if in this tool that has all the functionality because I currently use on another site.
Thanks for any help and understanding.

Mit
3daystrader
 
Posts: 4
Joined: Thu Aug 13, 2015 7:07 am

Re: help with some code writing

Postby Overload » Wed Aug 19, 2015 4:18 pm

I like to add my filter average volume of last 3 days and last 30 days.
this is the correct? mov(v,3,s) > 300000 for the average of last 3 days?

Yes, that is correct.

and i like to use psar(0.02, 0.20) Falling all the way from upside to downside and the difference between the dots is more and more bigger.
can i add here some chart to be more clearly like symbol "PER" with Psar indicator ?

Yes, you can add any indicators you want to a chart. For some quick help on how to use the charts, see Tutorial #2: Working with Charts in the StrataSearch Help. In the Adding and Removing Calculations example, you can just use your psar formula instead of the rsi used in the example.

Also, if you save your psar chart, you can set it to open by default from the Screener. Open the Setups > Default Charts menu, and then change the Screener Results to the chart of your choice. Then, when you double-click on a symbol in the Screener, it will open that chart.

I this situataion i need to use variables?

No, variables are not used with either the Chart or the Screener.

Pete
Overload
 
Posts: 2248
Joined: Wed Nov 30, 2005 12:14 pm


Return to General Discussion