NexusFi: Find Your Edge


Home Menu

 





how to code a trendline from a moving average cross?


Discussion in MultiCharts

Updated
    1. trending_up 7,444 views
    2. thumb_up 12 thanks given
    3. group 1 followers
    1. forum 19 posts
    2. attach_file 4 attachments




 
Search this Thread

how to code a trendline from a moving average cross?

  #1 (permalink)
 
program's Avatar
 program 
CA USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: DDT+land/Rithmic/IQ
Trading: S&P500,6E,YM
Posts: 99 since Nov 2010
Thanks Given: 127
Thanks Received: 64

fairly straight forward but giving me trouble, please bear with me, still learning.
how would you code a trend line or tl_new statement to draw a line from a moving average crossing?? then maybe end on subsequent prices of moving averages, or high pivot or current high...
basically i'm having trouble capturing a MA cross for a trend line statement
here is a snippet of code that i've learned for pivots... how would i modify it for ma cross trend lines??
 
Code
condition1 = Pivot(L,25,leftstrength,rightstrength,1,-1,oPivotPrice1,oPivotBar1) <>-1;

condition2 = Pivot(L,25,leftstrength,rightstrength,2,-1,oPivotPrice2,oPivotBar2) <>-1;

TL_new(D[oPivotBar2], T[oPivotBar2], L[oPivotBar2],
      D[oPivotBar1], T[oPivotBar1], L[oPivotBar1]);
Thanks,

I have approximate answers, possible beliefs and different degrees of certainty of different things. But I'm not absolutely sure of anything and there are many things i don't know anything about.
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
ZombieSqueeze
Platforms and Indicators
MC PL editor upgrade
MultiCharts
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

Hi,

( It is not because I am asking a question that I will have time to code it. So, if somebody else wants to propose a code, do not hesitate! :-) )

Could you clarify what the second point of the trendline is?
I mean:
When there is a MA crossover, you want a trendline to be drawn between this crossover and which point?

Nicolas

Envoyé depuis mon GT-I9100 avec Tapatalk

Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769


And is it linked to this method presented by @creekboy ?
If yes, it is not a problem, but I prefer that he be informed, by politeness.

Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

Enclosed please find a code.

Each time there is an EMA crossover, it draws a trendline between:
- the said EMA crossover, and
- the middle of the two EMA at the time of the next swing point.
The arrows identify all swing points (strength = 3), for checking purpose. They could be deleted.

I have done it in 10 minutes, so there may be mistake inside. At least, it is a basis to build from.

Nicolas


Attached Files
Elite Membership required to download: TrendLineAtMACrossover.txt
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #5 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

Here is an improved version: v2.

With the help of some mathematical calculations, the trendlines now pass exactly through the crossovers. Refer to the red circles on the pic.

Nicolas


Attached Files
Elite Membership required to download: TrendLineAtMACrossover - v2.txt
Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 creekboy 
phl pa. usa
 
Experience: Advanced
Platform: tos
Trading: es
Posts: 1,126 since Mar 2012
Thanks Given: 106
Thanks Received: 347

nicolas -thats close in some areas and way off in others -the ma cross is the chart i use for pivot trading -if you refer to the original post you will see the setup i use for day trading -close only counts in handgrenades :sos:





Nicolas11 View Post
Here is an improved version: v2.

With the help of some mathematical calculations, the trendlines now pass exactly through the crossovers. Refer to the red circles on the pic.

Nicolas



:when you cheat -you only cheat yourself
refer to post # 470 & 527 & 930
option traders refer to post 996 thru 1005
Visit my NexusFi Trade Journal Reply With Quote
  #7 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

Hi @creekboy,

I am not very comfortable with the situation and I would like to clarify something. I am not trying to duplicate/code your method, and I will not. Actually, I do not even know what your method is.

The story is...
When I started to work on the original question of @program, it rang a bell. "I have already seen this kind of line originating from MA crossover somewhere...". And I remembered your thread.
I was a bit embarrassed.
Perhaps @program was working on your method. Perhaps not. In any case, I preferred to put you in the loop rather than do things "in your back".

But I do not ask you to comment my work in order to move the code closer to your method. Actually I do not ask you anything. And I do not want to move the code closer to your method. I just wanted you to be informed in case this was in relation with your method. But perhaps it is not.

My purpose was just to answer to @program's original question and I think that I did it. I am ready to make minor modifications if he has additional clear specifications. But I will not go further anyway.

Nicolas

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #8 (permalink)
 creekboy 
phl pa. usa
 
Experience: Advanced
Platform: tos
Trading: es
Posts: 1,126 since Mar 2012
Thanks Given: 106
Thanks Received: 347

Nicholas- its very nice to meet a person of integrity -and i thankyou for that -no has asked or has been granted and rights to this system - i find it interesting that with all the knowledge on this forum that something new came still show up and work so well ,that any new trader can find success without being bled for his hard earned money to point them in the way of profit so easily -

some think -how can someone put something so important out there -but at 53 years of age maybe its put out there because something easier and better has been found -

but i repeat -no-one has been granted any rights to this system -

i may be a creekboy but i am no kid








Nicolas11 View Post
Hi @creekboy,

I am not very comfortable with the situation and I would like to clarify something. I am not trying to duplicate/code your method, and I will not. Actually, I do not even know what your method is.

The story is...
When I started to work on the original question of @program, it rang a bell. "I have already seen this kind of line originating from MA crossover somewhere...". And I remembered your thread.
I was a bit embarrassed.
Perhaps @program was working on your method. Perhaps not. In any case, I preferred to put you in the loop rather than do things "in your back".

But I do not ask you to comment my work in order to move the code closer to your method. Actually I do not ask you anything. And I do not want to move the code closer to your method. I just wanted you to be informed in case this was in relation with your method. But perhaps it is not.

My purpose was just to answer to @program's original question and I think that I did it. I am ready to make minor modifications if he has additional clear specifications. But I will not go further anyway.

Nicolas


:when you cheat -you only cheat yourself
refer to post # 470 & 527 & 930
option traders refer to post 996 thru 1005
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #9 (permalink)
 
program's Avatar
 program 
CA USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: DDT+land/Rithmic/IQ
Trading: S&P500,6E,YM
Posts: 99 since Nov 2010
Thanks Given: 127
Thanks Received: 64


Nicolas11 View Post
Hi @creekboy,

I am not very comfortable with the situation and I would like to clarify something. I am not trying to duplicate/code your method, and I will not. Actually, I do not even know what your method is.

The story is...
When I started to work on the original question of @program, it rang a bell. "I have already seen this kind of line originating from MA crossover somewhere...". And I remembered your thread.
I was a bit embarrassed.
Perhaps @program was working on your method. Perhaps not. In any case, I preferred to put you in the loop rather than do things "in your back".

But I do not ask you to comment my work in order to move the code closer to your method. Actually I do not ask you anything. And I do not want to move the code closer to your method. I just wanted you to be informed in case this was in relation with your method. But perhaps it is not.

My purpose was just to answer to @program's original question and I think that I did it. I am ready to make minor modifications if he has additional clear specifications. But I will not go further anyway.

Nicolas

Hello all, thanks for the responses...
I absolutely got this from CreekBoy, i was impressed with the simplicity of his system and style. I thought it would be a great exercise for my meager easylanguage ability... It's not my intention to plagiarize his method, just learn, or better my coding from it. I've already mentioned this to CreekBoy, and my lack of progress, with his recommendation to enlist help from Cory.
...but then again i never said/mentioned I wanted to start a thread requesting help.
in retrospect this may be insensitive.
I don't want to ruffle any feathers or step on any toes...
@creekboy you have PM

I have approximate answers, possible beliefs and different degrees of certainty of different things. But I'm not absolutely sure of anything and there are many things i don't know anything about.
Started this thread Reply With Quote
  #10 (permalink)
 
program's Avatar
 program 
CA USA
 
Experience: Intermediate
Platform: MultiCharts
Broker: DDT+land/Rithmic/IQ
Trading: S&P500,6E,YM
Posts: 99 since Nov 2010
Thanks Given: 127
Thanks Received: 64



creekboy View Post
Nicholas- its very nice to meet a person of integrity -and i thankyou for that -no has asked or has been granted and rights to this system - i find it interesting that with all the knowledge on this forum that something new came still show up and work so well ,that any new trader can find success without being bled for his hard earned money to point them in the way of profit so easily -

some think -how can someone put something so important out there -but at 53 years of age maybe its put out there because something easier and better has been found -

but i repeat -no-one has been granted any rights to this system -

i may be a creekboy but i am no kid

just to clarify, It's not my intention to have rights to, or copy, CreekBoy's system... just learn MC Powerlanguage and how trend lines can be drawn from MA crosses or other events for that matter... most trend lines are based off prices in time not events. I found that interesting in CreekBoys system. Apologies for any perceived insensitivity or lack of integrity.

we can lock it up if I've rubbed anyone the wrong way

I have approximate answers, possible beliefs and different degrees of certainty of different things. But I'm not absolutely sure of anything and there are many things i don't know anything about.
Started this thread Reply With Quote




Last Updated on July 30, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts