Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Hi
I have an EL problem that I hope someone can help me solve.
I am testing a strategy that trades of a line break chart and I want to go long or short if 1 of 2 conditions are met . The second part .. the else part is working fine it is the first part of the equation that I can’t get to work ??
Rule for a long position
1. IF High 2 bars back – Low 1 bar back is bigger than 10 ticks then buy …… etc else.
This is what I have
Input: Bars_back (2), Entry_distance(10)
Vars: Entry_min(0)
Variable Condition:
Entry_min = Entry_distance*ticksize
Code:
if (high[barsback] -low[1])*ticksize > entry_min then ………
what is wrong with this code ??
rgds
Mengelbrecht
Can you help answer these questions from other members on NexusFi?
Don't have a direct solution for you, but maybe you could join Multicharts forum to ask. Free for owner of licence. Their is a very good support and help from these guy's.
You'll need to provide more concrete information before we can really be of help here. For example, the "1 of 2 conditions" are not in the code, and the 'ticksize' variable is also undefined. Also a screenshot and the use of the [ code ] ... [ / code ] wrappers around your code would make your post easier to understand.
For our help to be more efficient, could you kindly explain precisely in your next post what your "problem" is.
I mean: what are your expecting from the code? and what is the actual result of the code (which does not satisfy you)?
Hi everyone attached you'll find the EL code. The code highligted in red is causing me a problem. This system basicly takes all the trades based on the "else" conditions, so I have come to the conclution that something is wrong with the first part os the entry conditions - the 64000 $ questions is what is wrong ??
I have attached a chart that hopefully explains what I am trying to achieve.
In words I want my entry condition to look like this
Example for a short condition
1: IF the distance between high[1] and low[2] is greater than Entry_dist then sellshort at low[2] - lmt_entry stop else
sellshort at low of current bar - lmt entry stop;
Hope it makes sense
Entry_dist shall be expressed in ticks: is it the case?
ticksize shall be in $ per tick, which is the case
entry_min is in $ (not in ticks): is it what you want?
"(high[1]-low[barsback] )*ticksize" is wrong, since $ is multiplied by $.
If you want $, just write "high[1]-low[barsback]".
If you want ticks, you have to divide by ticksize: "(high[1]-low[barsback] ) / ticksize"
Hi Nicholas
a HUUUGE thank you for your input
- I have changed the code see below - changed from multiply to devide :-).
All trades is now done based on the first rule - no validation seems to take place - see attached screenshot. The arrow point to an entry that should been based on the second (else) rule.
But take care, there might still be an issue:
(high[barsback] -low[1])/ticksize > entry_min
Left size of the inequality is in ticks
Right size of the inequality is in $ (if entry_min is still defined by "Entry_min = Entry_distance*ticksize;")