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)
First off all here is a screenshot from my actual setup, below indicator is DMI. What I am trying to achieve is that trades triggered from the strategy should be avoided if +DMI is not equal or bigger than 45. As you can see on below example +DMI is actual at 34,05
I tried to change the code the following way(shown in red), but still trades gets triggered which are below 45 (+DMI).
Would be great if somebody could tell me what actually I am doing wrong here.....
Thanks a lot guys
Can you help answer these questions from other members on NexusFi?
1) I can't see if you're using IOG or not, but if so, then intrabar, the value for your variable may indeed be above a certain threshold, but then settle to a lower point later in the bar and appear to have been less when reviewing later on (which only reveals the variable's final closing value, not the entire range of values it covered during the time period).
2) Prior to your if then begin string......you have a constraint (if currentshares = LTT then begin...)
What is the default value if your constraint is false?
I personally declare variables at the front of the program, I can't see the rest of your code to see if there's a reason you include it inside your if then string.
3) You need to label your entries and exits, if you have other entrie sources in your code, this will help identify which entry criteria is triggering the entry.
First of all, thanks to your reply! In order to give you an overview what I am trying to accomplish, following information:
Im am trying to modify the original Turtle system, based on a 20/55 Donchian breakout to perform as below:
Use only 90 days as a breakout signal in each direction (long/short)
Additional DMIplus (long) or DMIminus (short) needs to be equal or higher than 45 (at first entry and afterwards for each pyramiding entry), if this condition is not given, skip those trades
Used Data is EOD only, no intraday action, if bar is the highest whitin 90 days, then enter at tomorrows open
Below a screenshot as it looks right now. The yellow and red dotted lines are from a additional indicator in order to check the entries/exits calculated by the strategy, this one has no influence on the strategy, just in use for verfication
inputs:
Breakoutlength: 90 --> yellow dotted line
Stoplength: 10 --> red dotted line (ATR exit)
N: 2 --> 2 times the true range
ATRlenght: 20
Below is the current status of the performed modifications of the original 20/55 Turtle system:
Hoping you can take a look at it in order to let me know what actually needs to be changed to achieve above defined requirements.
The if statements apply only to the next line unless there is a "begin...end", so it seems you need to review the strategy carefully to ensure the logic is correct. For example regarding you DMI value it look slike it should say:
if value99>=45 then
-----begin
-----------buy LTT shares next bar highest(h,90)[BB] + (0.5*N) or higher;
-----------buy LTT shares next bar highest(h,90)[BB] + (1.0*N) or higher;
-----------buy LTT shares next bar highest(h,90)[BB]+ (1.5*N) or higher;
-----end;
The best way to 'see' the structure would be to properly indent all begin end blocks, for example:
if A = B then
--------begin
--------------if C=D then
----------------------begin
--------------------------------statement1;
--------------------------------statement2;
----------------------end;
--------end;
Another comment is that the SetStopLoss whould never be within an If statement. This may result in there being no stoploss, not because of the strategy logic but just an "anomally" with easylanguage.
Part of debugging is coding with a certain organization. That's why it helps to ensure that you follow the textbook grouping and sequence of coding.
TS has templates that will help you stay organized. Generally you start with inputs, then variables, then you declare your variables, then you work the body of your program, entries, then money management and exits.
Something as simple as placing variable declaration in the wrong location can screw things up.