NexusFi: Find Your Edge


Home Menu

 





Opening Range Custom


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
 
simon14's Avatar
 simon14 
TORONTO
 
Experience: Advanced
Platform: multi charts
Trading: crude cl
Posts: 19 since Sep 2016
Thanks Given: 10
Thanks Received: 6

So i have taken a couple diff systems and combined them, iam fairly new at EL and iam getting stuck atm trying to make the Open range midpoint the stop for the system any ideas what iam missing ?? It produces the entries but not the exits. In the future i want to make daily pivot extensions the targets but thats one day at a time here lol. I Have underlined the new code i added where the problems are most likely located. This is one of big mikes strategies iam changing to my method slowly while i learn EL.

thank you

Inputs:
startTime ( 8 ),
endTime ( 11 ),
startTradeTime ( 11 ),
stoploss ( 16 ),
target1 ( 32 ),
target2 ( 16 ),
target3 ( 72 ),
datramt ( 1 );

variables:
sessHi (0),
sessLo (0),
sessOp (0),
sessMid (0);

if date <> date[1] then begin
sessOp = Open;
sessLo = Low;
sessHi = High;
sessMid = (( high + low ) * 0.50 );

end;

if time < endTime * 100 then begin
if High > SessHi then SessHi = High;
if Low < SessLo then SessLo = Low;
end;

SetStopContract;

SetStopLoss( stoploss * BigPointValue );

// entries


if Close > SessHi then begin
Buy 3 Contracts Next Bar At Market;

end;
if Close < SessLo then begin
Sellshort 3 Contracts Next Bar At Market;
end;

// order management

if marketposition = 1 then begin

if currentbar < sessMid then sell 3 contracts next bar at open;

if marketposition = -1 then begin

if currentbar > sessMid then sell 3 contracts next bar at open;

end;

end;


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Assigning value to swing high and low points: 2, 1, -1, -2
Traders Hideout
Small Indicator to visually see Nth Bar Close - NT8
Traders Hideout
Using multiple Versions of the same DLL in MC.Net
MultiCharts
How to look up market depth?
MultiCharts
GANN THEORY DAVID BOWDEN SAFETY IN THE MARKETS
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Tariffs and what comes next...
39 thanks
Looking for advice from seasoned TopSteppers
5 thanks
Lady Vols Primer: Trading Volatility Journal
5 thanks
Converting NT7 indicators to NT8 for free
3 thanks
Big Mike in Ecuador
3 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639


Hi simon14,

with the code below you check for a bar number being above/below a price as an exit condition. While the code will verify and eventually trigger signals, I doubt that this is what you intend to do.
 
Code
if currentbar < sessMid then sell 3 contracts next bar at open;

if currentbar > sessMid then sell 3 contracts next bar at open;
For your entries you check for "Close" being above/below a trigger price and this is what I'd suggest to test for your exits, too.

Regards,

ABCTG


Follow me on X Reply With Quote
Thanked by:




Last Updated on October 7, 2016


© 2025 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