Print values - dates only with Moving Average crossing - TradeStation | futures io social day trading
futures io futures trading


Print values - dates only with Moving Average crossing
Updated: Views / Replies:421 / 7
Created: by jlsegsan Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Print values - dates only with Moving Average crossing

  #1 (permalink)
Trading Apprentice
Madrid
 
Futures Experience: None
Platform: Tradestation
Favorite Futures: Nasdaq
 
Posts: 6 since Feb 2018
Thanks: 0 given, 0 received

Print values - dates only with Moving Average crossing

Apologies in advance I am an absolute beginner

I coded a simple indicator to plot 3 moving averages
Then I add the condition of the first 2 crossing
I want to apply this indicator to the Radar where I have selected some values
My info extraction would be very simple at first:

- Future / Stock - Date - Value at which the 2 Moving Averages have crossed
but get data extraction only in the date in which I have a crossing, I don't need the Dates and Values without any Moving average crossing

I have managed to write the Plot part, even the Condition, but I don't know how to code the Print part

Your help would be really appreciated

My coding Inputs:

Price (Close),
Length1 (2),
Length2 (11),
Length3 (22),
ConfirmBars( 1 ) ;

Variables:

FileName (" "),
Counter( 0 );
{ Plot1 Averages on chart }

Plot1 ( AverageFC(Price , Length1), "Avg1");
Plot2 ( AverageFC(Price , Length2), "Avg2");
Plot3 ( AverageFC(Price , Length3), "Avg3");


if AverageFC(Price, Length1) > AverageFC( Price, Length2 ) then
Counter = Counter + 1;
if Counter = ConfirmBars then


Print ("Date -",ELDateToString(Date)," Avg1", Plot1:3.3, " Avg2", Plot2:3:4, " Avg3", Plot3:3:5) ;
If Currentbar = 1 then Print(File("C:\TestTemp.txt"),"Date - ",";"," Avg1 ",";"," Avg2 ",";"," Avg3 ") ;
Print(File("C:\TestTemp.txt"), ELDateToString(Date),";", Plot1:3.3, ";", Plot2:3:4, ";", Plot3:3:5) ;

Reply With Quote
 
  #2 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,777 since Apr 2013
Thanks: 283 given, 1,061 received

jlsegsan,

welcome to futures.io.

What do you intend to do with the prints? Any display in Radarscreen is done via plots, while the output of the print reserved word appears in the "EasyLanguage Print Log".
If you want to display the date in Radarscreen, you could store the date in a variable when your condition is true. Then you can plot plot this variable directly or convert it via ELDateToString and plot the string (you can also set the grid style to date for the latter under the indicator properties: Format Analysis Technique - Grid Style).

You can find a good example here: https://community.tradestation.com/Discussions/Topic_Archive.aspx?Topic_ID=36248

Regards,

ABCTG

Reply With Quote
 
  #3 (permalink)
Trading Apprentice
Madrid
 
Futures Experience: None
Platform: Tradestation
Favorite Futures: Nasdaq
 
Posts: 6 since Feb 2018
Thanks: 0 given, 0 received


Thanks ABCTG

The link you included in your reponse is exactly what I want: to display the date in Radarscreen

I must be too new in coding Easy language ....Believe me I have tried to apply all that to display the date in Radarscreen when the last EMA Crossing took place.

I tried really hard in order not to be a pain in the neck to you, coming back with every single question I have, but I must admit I have not been succesful, the more things I try the worst

I believe that coding this for you must be a walk in the park ... can you help me

Thank you in advance
This is what I have

inputs:
Price( Close ) ,
Length1 ( 11 ) ,
Length2 ( 22 ) ;


variables:
ExpAv1 ( 0 ) ,
ExpAv2 ( 0 ) ,
_EMA1122 ( False ) ,

HaveUpCross ( False ) ,
HaveDnCross ( False ) ,
UpCrossPlot ( "-" ) ,
DnCrossPlot ( "-" ) ,
UpCrossValue ( 0 ) ,
DnCrossValue ( 0 ) ,
UpCrossDay ( 0 ) ,
DnCrossDay ( 0 ) ,
DayCounter ( 0 ) ;

ExpAv1 = XAverage ( Price , Length1 ) ;
ExpAv2 = XAverage ( Price , Length2 ) ;

if ExpAv1 > ExpAv2

then Begin
_EMA1122 = True ;
Plot1( _EMA1122 , "EMA 11-22" ) ;
end

else Begin
_EMA1122 = False ;
Plot1( _EMA1122 , "EMA 11-22" ) ;
end ;

// retrieve date of the last EMA crossing

Reply With Quote
 
  #4 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,777 since Apr 2013
Thanks: 283 given, 1,061 received

jlsegsan,

I would suggest checking out the reserved words "crosses over" and "crosses under". These should help you in detecting that the averages crossed. When you are able to detect this, you can save the date at the moment you detect the cross in a variable and plot this variable later.

Regards,

ABCTG

Reply With Quote
 
  #5 (permalink)
Trading Apprentice
Madrid
 
Futures Experience: None
Platform: Tradestation
Favorite Futures: Nasdaq
 
Posts: 6 since Feb 2018
Thanks: 0 given, 0 received

Thanks ABCTG

My issues ... really appreciate your guidance on them


1. Keeps being how to store the date

//store the date of the bullish cross
if ExpAv1 crosses over ExpAv2

then begin
HaveUpCross = true;
UpCrossDay = ??? // don't know how to capture the date
end ;

2. Once we have the bullish cross Date in the past ... I want to check how it worked
Like a backtesting but forward looking ... making the most of the Radar capabilities, checking for all components of an Index)
I know how to do it backward looking (with "offset") but not forward looking
Backward looking would be ... with the Close Date

plot1(CurrentBar, "Bar Nr");

inputs: offset1(20), offset2(40), offset3(60), offset4(80), offset5(100), offset6(120); // each month has typically 20 trading days

// Net gained (or lost) in each period

plot1(1-c[offset5]/c[offset6], "Net%1");
plot2(1-c[offset4]/c[offset5], "Net%2");
plot3(1-c[offset3]/c[offset4], "Net%3");
plot4(1-c[offset2]/c[offset3], "Net%4");
plot5(1-c[offset1]/c, "Net%5");

Reply With Quote
 
  #6 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,777 since Apr 2013
Thanks: 283 given, 1,061 received

jlsegsan,

you can get the date of a bar using the reserved word Date.

Regards,

ABCTG

Reply With Quote
 
  #7 (permalink)
Trading Apprentice
Madrid
 
Futures Experience: None
Platform: Tradestation
Favorite Futures: Nasdaq
 
Posts: 6 since Feb 2018
Thanks: 0 given, 0 received

Hi ABCTG

I tried to store the date in a variable when the condition is true, using the word Date ... without success
I have managed only to work deducting days from the current one (Date [1]) … but I have not been able to link it to the crossing day of the moving averages, to store that date

I also tried to find another thread with something similar, again without success

Please can you code this for me, or give me a thread with a solution similar to the one I am looking for

PS: I was also asking how to do backtesting but forward looking ... making the most of the Radar capabilities, checking for all components of an Index
I know how to do it backward looking (with "offset") but not forward looking
Do you know what word can I use for this?

Best regards

Reply With Quote
 
  #8 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,777 since Apr 2013
Thanks: 283 given, 1,061 received

jlsegsan,

I can try to point you in the right direction, but it's hard without knowing the actual code changes that you made.

I am not sure I understand your intentions regarding forward looking. The code is generally evaluated bar by bar starting with the first bar, so you might face the problem that values in the future are not yet calculated on historical bars.

Regards,

ABCTG

Reply With Quote

Reply



futures io > > > > Print values - dates only with Moving Average crossing

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

September Journal Challenge (sponsored by TopstepTrader)

September

Free Elite Membership: Twitter Tuesday and Facebook Friday!

Tue & Fri
 

Trading with Python: Using Machine Learning w/Ran Aroussi [12:30PM ET]

Elite only

TopstepTrader (TBD)

Sep 25

RandBots (TBD)

Sep 27

Anthony Drager (TBD)

Oct 4
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help please - moving spreadsheet values into constant lines indicator aquarian1 NinjaTrader Programming 35 January 12th, 2018 11:37 AM
moving average monsieur NinjaTrader 1 November 29th, 2015 05:23 PM
Multiple moving average crossing strategy parsamkk The Elite Circle 7 August 5th, 2013 09:07 AM
Moving Average Kush NinjaTrader Programming 5 November 6th, 2011 12:49 PM
I'm trying to print the values from an ArrayList kaywai NinjaTrader Programming 13 May 13th, 2011 09:33 AM


All times are GMT -4. The time now is 05:57 AM. (this page content is cached, log in for real-time version)

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2018-09-20 in 0.14 seconds with 30 queries on phoenix