NexusFi: Find Your Edge


Home Menu

 





Opening Range Custom


Discussion in EasyLanguage Programming

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




 
Search this Thread

Opening Range Custom

  #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?
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
70 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
Bigger Wins or Fewer Losses?
24 thanks
The Program
20 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628


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




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