NexusFi: Find Your Edge


Home Menu

 





Very simple easy language Help


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one ttsang with 2 posts (0 thanks)
    2. looks_two Quick Summary with 1 posts (0 thanks)
    3. looks_3 Big Mike with 1 posts (1 thanks)
    4. looks_4 ejtrader with 1 posts (0 thanks)
    1. trending_up 4,501 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
ttsang
newyork
 
Posts: 2 since Jun 2011
Thanks Given: 0
Thanks Received: 0

i have a set of conditions that will return true or false. Lets say i have condition1 to 5. i want condition1 and 2 happen 2 bars earlier and condition3 1 bar earlier then execute a buy.

but i just cant make it happen, it said Types are not compatible. this is what i did.

if condition 1 or condition2 = true and condition3 or condition4 = true then buy next bar at market;

but how can i make it two bars earlier for condition1 or 2 and one bar earlier for condition 3 or 4?


so what should i do to make it work?

any help would be greatly appreciate.

thanks


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
New Section 301 Probes Target 16 Trading Partners -- Tra …
Traders Hideout
Irans Answer Due Today: Peace Surges to 33.5%, Invasion …
Prediction Markets & Event Contracts
CME Launches Bitcoin Volatility Futures June 1 -- First …
Cryptocurrency
Orban at 29pct as Hungary Votes Tomorrow -- McIlroy Surg …
Prediction Markets & Event Contracts
Q1 2026 Shatters All Derivatives Volume Records -- CME H …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,557


When evaluating condition1, use the bars index to go back 2 bars.

condition1 = Average(C, 20)[2] > C[2];

This would look at the SMA and the Close from 2 bars ago.

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
ttsang
newyork
 
Posts: 2 since Jun 2011
Thanks Given: 0
Thanks Received: 0

Thank you mike my fomular is like:

condition1 = false;
if close>close[1] and close[2]>close[1] then condition1= true;

so what i have to do is

if(close>close[1] and close[2]>close[1])[1] then condition1= true;

this one get one bar ahead

i actually think about it for a long time until i saw your comment then get me how to do it

Thanks


Reply With Quote
  #5 (permalink)
 ejtrader 
Portland, OR
 
Experience: Intermediate
Platform: Sierra Chart
Trading: ES
Posts: 269 since Jan 2011
Thanks Given: 327
Thanks Received: 180

you can also use some combination like MRO/LRO ( most/least recent occurrences) to check - how recent was the last event occurred.

Would see if I can find the syntax for it.

Thanks.


Reply With Quote




Last Updated on March 8, 2012


© 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