NexusFi: Find Your Edge


Home Menu

 





Rewriting BarsSinceExit(1) on data2


Discussion in Traders Hideout

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




 
Search this Thread

Rewriting BarsSinceExit(1) on data2

  #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

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
Deepmoney LLM
Elite Quantitative GenAI/LLM
Futures True Range Report
The Elite Circle
 
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623


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 Twitter Reply With Quote




Last Updated on May 16, 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