NexusFi: Find Your Edge


Home Menu

 





Print only once when using 3 times frames


Discussion in MultiCharts

Updated
    1. trending_up 1,389 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

Print only once when using 3 times frames

  #1 (permalink)
 stefanols 
Helsingborg
 
Experience: Intermediate
Platform: Bullcharts, Multicharts
Trading: ES and scandinavian Stocks
Posts: 17 since May 2011
Thanks Given: 6
Thanks Received: 5

Hi,

I would like to ask how to create a check to avoid triple or 5 fold prints due to higher time frame. I collect events that happen on 3,9,27 min. But if it happens on 27 min it prints many times hence higher TF. See code example below.

Thanks in advance // BR Stefan

 
Code
Inputs: RSIL(2);
variables:  var0( 0 ) ;

var0 = RSI(Close,RSIL);

   value11= var0;
   value12= var0 of data2;
   value13= var0 of data3;


Condition10= (value11[0] crosses below 10 ); 

Condition11= ( value12[0]  crosses below 10 ); 

Condition12= ( value13[0] crosses below 10 ); 


If condition10 then plot1 (7,"RSI cross < 10 time frame1",red,default,5);
If Condition11 then plot2 (7,"RSI cross < 10 time frame2",red,default,8);
If Condition12 then plot3 (7,"RSI cross < 10 time frame3",red,default,11);

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Request for MACD with option to use different MAs for fa …
NinjaTrader
ZombieSqueeze
Platforms and Indicators
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
67 thanks
Battlestations: Show us your trading desks!
48 thanks
NexusFi site changelog and issues/problem reporting
47 thanks
GFIs1 1 DAX trade per day journal
32 thanks
What percentage per day is possible? [Poll]
31 thanks

  #2 (permalink)
 choke35 
Germany
 
Experience: Intermediate
Platform: Other
Trading: ES, YM, 6E
Posts: 2,668 since Feb 2013
Thanks Given: 5,101
Thanks Received: 6,558

I don't use your platform, but in general "else" clauses are made for your problem.

Instead of running the conditions sequentially, link them with else clauses.
In pseudo code, start with the highest time frame and work down to the lowest like that:
 
Code
if (highestTF)
    {}
else if (mediumTF)
    {}
else if (lowestTF)
    {}

That way your program will only execute the code for the highest time frame that fills
your condition and skip the others.

Reply With Quote
The following user says Thank You to choke35 for this post:
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623


stefanols,

what @choke35 suggested might work. You can try to only plot and the end of the respective bar (timeframe 1, 2 or 3). I would also suggest not to use the standard value1 and condition1 variables, but create your own ones and tie them to the datastreams (as not they are tied to data1 and you evaluate them with every data1 update).

Regards,

ABCTG



stefanols View Post
Hi,

I would like to ask how to create a check to avoid triple or 5 fold prints due to higher time frame. I collect events that happen on 3,9,27 min. But if it happens on 27 min it prints many times hence higher TF. See code example below.

Thanks in advance // BR Stefan

 
Code
Inputs: RSIL(2);
variables:  var0( 0 ) ;

var0 = RSI(Close,RSIL);

   value11= var0;
   value12= var0 of data2;
   value13= var0 of data3;


Condition10= (value11[0] crosses below 10 ); 

Condition11= ( value12[0]  crosses below 10 ); 

Condition12= ( value13[0] crosses below 10 ); 


If condition10 then plot1 (7,"RSI cross < 10 time frame1",red,default,5);
If Condition11 then plot2 (7,"RSI cross < 10 time frame2",red,default,8);
If Condition12 then plot3 (7,"RSI cross < 10 time frame3",red,default,11);


Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:





Last Updated on June 25, 2016


© 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