Counting for RadarScreen - EasyLanguage Programming | futures io social day trading
futures io futures trading


Counting for RadarScreen
Updated: Views / Replies:1,369 / 6
Created: by haonkered 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 90,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
 

Counting for RadarScreen

  #1 (permalink)
Elite Member
Houston, Texas, United States
 
Futures Experience: Beginner
Platform: TradeStation
Favorite Futures: Futures
 
Posts: 25 since Jun 2013
Thanks: 10 given, 4 received

Counting for RadarScreen

I am looking for some guidance on how to start a "count", positive or negative, based on when an indicator occurred and would like to be able to show this in radar screen. I am using the 50/200d ma crossover and would like to show how many days back this occurred for each of the symbols on the radar screen. For bullish crossovers looking to show on radarscreen "L1" if the crossover occurred today, "L2" if yesterday, etc. And then S1, S2, S3, etc for days back the bearish crossover occured. Would like to be able to do this for multiple indicators eventually, MACD, SMA, etc but cannot seem to find any good resources online to read about how to start "the" counting....

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary


haonkered,

one idea would be to count the days the study is running and then store the day count when a cross happens. Based on this I created this simple indicator for you. With every new day you can calculate how many days back a cross occurred.
When you load this indicator make sure to load enough "additional data for accumulative calculations". As you are using a Moving Average with 200 bars length I would suggest to load something around 1000 bars to give the indicator the chance to produce a cross over.

Regards,
ABCTG

 
Code
Variables:
	HaveUpCross		(false),
	HaveDnCross 		(false),
	UpCrossPlot 		("-"),
	DnCrossPlot 		("-"),
	UpCrossValue 		(0),
	DnCrossValue		(0),
	UpCrossDay		(0),
	DnCrossDay 		(0),
	DayCounter 		(0),
	MA50			(0),
	MA200 			(0);

//count days
if Date <> Date[1] then
	DayCounter = DayCounter + 1;
		
MA50 = Average(Close, 50);
MA200 = Average(Close, 200);

//bullish cross
if MA50 crosses over MA200 then
begin  
	//store the day of the upcross
	UpCrossDay = DayCounter;
	HaveUpCross = true;
end;

//bearish cross
if MA50 crosses under MA200 then
begin 
	//store the day of the dncross
	DnCrossDay = DayCounter;
	HaveDnCross = true;
end; 

if HaveUpCross then
begin
	//calculate how many days back the up cross occured
	UpCrossValue = DayCounter - UpCrossDay;
	UpCrossPlot = NumToStr(UpCrossValue, 0) + "L";
end;	
if HaveDnCross then
begin
	//calculate how many days back the dn cross occured
	DnCrossValue = DayCounter - DnCrossDay;
	DnCrossPlot = NumToStr(DnCrossValue, 0) + "S";
end;	

Plot1(UpCrossPlot, "Up Cross");
Plot2(DnCrossPlot, "Dn Cross");

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #4 (permalink)
Elite Member
Houston, Texas, United States
 
Futures Experience: Beginner
Platform: TradeStation
Favorite Futures: Futures
 
Posts: 25 since Jun 2013
Thanks: 10 given, 4 received

Thanks. Seems to be working well. I do have a question however...is there a way to count 01, 02, 03....10,11,12 so that when sorting in RadarScreen the crosses from 1 day ago are not followed by the crosses 11 days ago, and then the 2s and 21s, etc etc

Reply With Quote
 
  #5 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

Great. Yes, this can be done by simply adding a 0 in those cases.
 
Code
Variables:
	HaveUpCross		(false),
	HaveDnCross 		(false),
	UpCrossPlot 		("-"),
	DnCrossPlot 		("-"),
	UpCrossValue 		(0),
	DnCrossValue		(0),
	UpCrossDay		(0),
	DnCrossDay 		(0),
	DayCounter 		(0),
	MA50			(0),
	MA200 			(0);

//count days
if Date <> Date[1] then
	DayCounter = DayCounter + 1;
		
MA50 = Average(Close, 50);
MA200 = Average(Close, 200);

//bullish cross
if MA50 crosses over MA200 then
begin  
	//store the day of the upcross
	UpCrossDay = DayCounter;
	HaveUpCross = true;
end;

//bearish cross
if MA50 crosses under MA200 then
begin 
	//store the day of the dncross
	DnCrossDay = DayCounter;
	HaveDnCross = true;
end; 

if HaveUpCross then
begin
	//calculate how many days back the up cross occured
	UpCrossValue = DayCounter - UpCrossDay;
	UpCrossPlot = NumToStr(UpCrossValue, 0) + "L";
	if StrLen(UpCrossPlot) <= 2 then
		UpCrossPlot = "0"+ UpCrossPlot;	
end;	
if HaveDnCross then
begin
	//calculate how many days back the dn cross occured
	DnCrossValue = DayCounter - DnCrossDay;
	DnCrossPlot = NumToStr(DnCrossValue, 0) + "S";
	if StrLen(DnCrossPlot) <= 2 then
		DnCrossPlot = "0"+ DnCrossPlot;	
end;	

Plot1(UpCrossPlot, "Up Cross");
Plot2(DnCrossPlot, "Dn Cross");
Regards,
ABCTG

Reply With Quote
 
  #6 (permalink)
Elite Member
Hyannis, MA
 
Futures Experience: Advanced
Platform: TradeStation
Favorite Futures: ES
 
Posts: 3 since Nov 2011
Thanks: 0 given, 2 received

Here is a very simple way to count the number of bars since any event occurred.

Here is an example for two events. The count number is preceded by a letter that you specify as an the Name input.

This uses "L" and "S".

---

Input:
Event1(Average(Close, 50) crosses over Average(Close, 200)), Name1("L"),
Event2(Average(Close, 50) crosses under Average(Close, 200)), Name2("S");

if Event1 then Value1 = 0 else Value1 = Value1 + 1;
if Event2 then Value2 = 0 else Value2 = Value2 + 1;

Plot1(Name1 + NumToStr(Value1,0), "E1");
Plot2(Name2 + NumToStr(Value2,0), "E2");
---

Simply enter the event you want to track as the Event input. Examples might include:

Average(Close, 50) crosses over Average(Close, 200)
RSI(Close, 14) > 50

Reply With Quote
The following user says Thank You to BobF for this post:
 
  #7 (permalink)
Trading Apprentice
Fort Walton Beach, Florida
 
Futures Experience: None
Platform: EasyLanguage
Favorite Futures: SP
 
Posts: 4 since Feb 2014
Thanks: 0 given, 0 received

Sorting

I think if you just remove the "L" and "S" and plot as a number then it will sort numerically. You already have column headers, I think, that identify the direction.

It is because it is a text sort that "L11" sorts before "L2".

Just a FYI...

Samuel

Reply With Quote

Reply



futures io > > > > > Counting for RadarScreen

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Backtest RadarScreen matthaius EasyLanguage Programming 3 August 2nd, 2013 08:10 PM
Problem with LowD on RadarScreen oliakaoil EasyLanguage Programming 2 July 29th, 2013 06:05 PM
Looking for a wave counting indicator reno57540 NinjaTrader 1 November 29th, 2012 03:57 PM
Counting on an Inheritance? Count Again. kbit News and Current Events 0 June 12th, 2012 08:49 PM
Q on signal counting in MC aczk EasyLanguage Programming 6 February 14th, 2012 11:35 AM


All times are GMT -4. The time now is 11:13 PM.

Copyright © 2017 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 2017-12-15 in 0.10 seconds with 19 queries on phoenix via your IP 54.163.210.170