NexusFi: Find Your Edge


Home Menu

 





Rewriting BarsSinceExit(1) on data2


Discussion in Traders Hideout

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




 
Search this Thread
  #1 (permalink)
 fiverr 
Calgary
 
Experience: None
Platform: TradeStation, MT4
Trading: ES, Stocks
Posts: 73 since Aug 2015
Thanks Given: 4
Thanks Received: 11

Hi there,

I am currently using MC and I have the following codes. The current code is working well and is attached to the 30M chart.

 
Code
      if (((BarsSinceExit(1)=0 AND ExitPrice(1)=HIGH) 
	  OR (BarsSinceExit(1)=1 AND  ExitPrice(1)=HIGH[1]))) 
      		AND (BarsSinceExit(1)=0 OR (ExitPrice(1)>= HIGH)) then cond_1 = false;
I am rewriting the above code for a new chart that has data1 as 1M and data2 as 30M.

Here is what I have done

 
Code
Variables: High_1(0, data(2));

High_1 = High of data(2);

  if (((BarsSinceExit(1)=0 AND ExitPrice(1) =HIGH_1) 
	  OR (BarsSinceExit(1) =1 AND  ExitPrice(1)=HIGH_1[1]))) 
      		AND (BarsSinceExit(1)=0 OR (ExitPrice(1)>= HIGH_1)) then cond_1 = false;
How can I be certain that BarsSinceExit(1) is referring to 30M and not 1M? Also do I need to worry about ExitPrice(1)? Being it is a price value, it should not matter if it is data1 or data2.

Please let me know you thoughts.


Started this thread Reply With Quote

 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639


fiverr,

I am not sure if you can use the reserved words for position information to obtain values from data 2, as you can only enter and exit on data1. Therefore you might have to store the information you need in variable and reference these later. For example store the bar number of data2 when your position exited. Then you can check the current data 2 bar number against this variable to obtain how many data2 bars passed since the exit.

Regards,

ABCTG


Follow me on X Reply With Quote




Last Updated on May 16, 2016


© 2026 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 - Downloads - Top
no new posts