Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I'm new to this forum and also new to EasyLanguage. The code is for trading mini-ES. I've been stuck for a few days on getting the code to set/record a reference value, i.e. close of 2 bars before an Entry bar. I tried with C[2] and it didn't work. I think the code kept re-calculate rather than record and keep that value unchanged. Here's what I have:
vars: RangeHigh(0), Value1(0);
If MarketPosition = 0 and Close > RangeHigh then
begin
buy next bar at market;
Value1 = Close[2];
end;
If MarketPosition = 1 then
sell ("stop") next bar at Value1 stop;
Thanks in advance!
Can you help answer these questions from other members on NexusFi?
welcome to futures.io. I would suggest using the print reserved word to check the value of Value1 (I would also suggest using meaningful variable names as this might make your programming life easier in the long run).
From glancing at your code, it should correctly store the value at the moment you issue the order.
one thing to keep in mind with your code is that you initialize RangeHigh with 0. This will make your condition true on the very first bar the code is evaluated on and you do not update the value stored in RangeHigh. This will result in a new order every time your code is flat.