NexusFi: Find Your Edge


Home Menu

 





EasyLanguage Code to stop strategy for the day


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one skiman721 with 9 posts (0 thanks)
    2. looks_two Nicolas11 with 4 posts (2 thanks)
    3. looks_3 sptrader with 1 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 15,513 views
    2. thumb_up 3 thanks given
    3. group 1 followers
    1. forum 12 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 skiman721 
North Bay
 
Experience: Intermediate
Platform: NT, ToS, MulitCharts
Broker: NT, TD
Trading: ES, CL
Posts: 39 since Nov 2011
Thanks Given: 10
Thanks Received: 9

I have created an EL signal using Multicharts but I'm missing one thing. I only want to strategy to trade during a certain period of time. What is the simplest way to have the strategy stop looking for the setup after a certain time (or number of bars would work) and not turn back on until the next day? Specifically - if the signal is not valid before 10am then it would not take a trade until the following day, if valid. I think having a valid time of 9:30-10:00 would work but I don't know how to code that.


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Renko can be the way.
Commodities
Wall St slides on mounting AI selloff, S&P 500, Dow …
Traders Hideout
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
What we know about Binances $6.3bn hack - BBC News
Cryptocurrency
Bitcoin’s 2022 low, 2025 high and 2026 low so far arou …
Cryptocurrency
 
  #3 (permalink)
 
sptrader's Avatar
 sptrader 
Colorado
 
Experience: Advanced
Platform: MultiCharts
Broker: IB & Iqfeed
Trading: ES , CL
Posts: 535 since Apr 2010
Thanks Given: 1,097
Thanks Received: 702


Try something like this :

If time >= 0930 and time <= 1000 then begin
"put your buy or sell condition here"
end;

" put your exit rules here"


Reply With Quote
Thanked by:
  #4 (permalink)
 skiman721 
North Bay
 
Experience: Intermediate
Platform: NT, ToS, MulitCharts
Broker: NT, TD
Trading: ES, CL
Posts: 39 since Nov 2011
Thanks Given: 10
Thanks Received: 9


sptrader View Post
Try something like this :

If time >= 0930 and time <= 1000 then begin
"put your buy or sell condition here"
end;

" put your exit rules here"

That works, Thanks!

Still learning EL... I have a lot of work to do.


Started this thread Reply With Quote
  #5 (permalink)
 skiman721 
North Bay
 
Experience: Intermediate
Platform: NT, ToS, MulitCharts
Broker: NT, TD
Trading: ES, CL
Posts: 39 since Nov 2011
Thanks Given: 10
Thanks Received: 9

I'm working on a opening gap signal. I only want the signal to trigger if the gap is between 8 and 20 ticks, nothing less, nothing more. Below is what I have but it is only triggering gaps of exactly 8 and 20 ticks. How do I get it to be a range?


 
Code
                            
//I have the Min and MaxGap as inputs.

if (High + MinGap) <= low[1] and (High + MaxGap) <= low[1] then
    buy 
( "GapDn - Buy" ) next bar at market ; 


Started this thread Reply With Quote
  #6 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,774

@kiman721,

What is your timeframe?
What is your definition of a "gap" ?
Shouldn't you compare C[1] and O instead of Highs and Lows?

Nicolas


Visit my NexusFi Trade Journal Reply With Quote
  #7 (permalink)
 skiman721 
North Bay
 
Experience: Intermediate
Platform: NT, ToS, MulitCharts
Broker: NT, TD
Trading: ES, CL
Posts: 39 since Nov 2011
Thanks Given: 10
Thanks Received: 9


Nicolas11 View Post
@kiman721,

What is your timeframe?
What is your definition of a "gap" ?
Shouldn't you compare C[1] and O instead of Highs and Lows?

Nicolas

Timeframe is 2 min bars (most promising timeframe profit wise so far)
Inputs: MinGap (8) and MaxGap (20) - want to make it adjustable by tick
I could do closeD[1] and open. I probably will do that because it's easier that defining a valid time for the signal (which is what I started to do to avoid any gaps after the open). I used Highs and Lows because I stated playing with the preloaded Gap entry signal in MC. I'm still learning, the only programming skills I have came from some HTML / C++ programing in High School.


Started this thread Reply With Quote
  #8 (permalink)
 skiman721 
North Bay
 
Experience: Intermediate
Platform: NT, ToS, MulitCharts
Broker: NT, TD
Trading: ES, CL
Posts: 39 since Nov 2011
Thanks Given: 10
Thanks Received: 9

Thanks Nicholas, The CloseD and Open is much easier.

This is what I have but its still taking trades > 20 and < 4 ticks. And randomly weeding out others.

 
Code
                            
[IntrabarOrderGeneration = True]


Inputs:
    
MaxGap        (20),
    
MinGap        (4);

vars:

    
TickSize    ( MinMove / PriceScale );

//Gap Down
if (Open + (MinGap * TickSize)) < CloseD(1) and (Open + (MaxGap * TickSize)) < CloseD(1) then
    buy 
( "GapDn - Buy" ) next bar at market ;
    
//Gap Up
if (Open - (MinGap * TickSize)) > CloseD(1) and (Open - (MinGap * TickSize)) > CloseD(1) then
    sellshort 
( "GapUp - Sell" ) next bar at market ;
end; 


Started this thread Reply With Quote
  #9 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,774

kiman721,

Your mathematical formula seem wrong.

 
Code
//Gap Down

if (Open + (MinGap * TickSize)) < CloseD(1) and (Open + (MaxGap * TickSize)) < CloseD(1) then

    buy ( "GapDn - Buy" ) next bar at market ;
The second "<" should be a ">", no?

Nicolas


Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #10 (permalink)
 skiman721 
North Bay
 
Experience: Intermediate
Platform: NT, ToS, MulitCharts
Broker: NT, TD
Trading: ES, CL
Posts: 39 since Nov 2011
Thanks Given: 10
Thanks Received: 9



Nicolas11 View Post
kiman721,

Your mathematical formula seem wrong.

 
Code
//Gap Down

if (Open + (MinGap * TickSize)) < CloseD(1) and (Open + (MaxGap * TickSize)) < CloseD(1) then

    buy ( "GapDn - Buy" ) next bar at market ;
The second "<" should be a ">", no?

Nicolas

Nicholas, I think your correct, I changed it and also adjusted the Gap up. I also needed to adjust the MinGap * Ticksize calculation. Looks to be working now.

Thanks for your help

Pete


Started this thread Reply With Quote




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