NexusFi: Find Your Edge


Home Menu

 





Stop all trading for day after 1 condition is met once.


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
Edwin Lefevre
Scotland
 
Posts: 27 since May 2019
Thanks Given: 11
Thanks Received: 4

Hi I am looking to stop all automated trading when a condition is met.

The condition typically only occurs once and then reverts back to the original state so I'm having trouble keeping trading stopped.

Condition1 = AvgTrueRange(1) >= 0.015;

Refers to one bar back.

How would I set this condition to continue being true after it has occured? Allowing for the creation of a statement to stop all trading for the day.


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Fed Hike Odds at 57% After Warsh: England Surges 12.9%, …
Prediction Markets & Event Contracts
Iran Talks Final Stages -- Two VLCCs Exit Hormuz, Record …
Traders Hideout
US Prop Firms Race Inside the CFTC Perimeter -- Tradeify …
Funded Trading Evaluation Firms
The June 15 Resolution Trap: Irans Agreed Text Still Pri …
Prediction Markets & Event Contracts
Iran Airspace Contract Surges to 33.5% as Project Freedo …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
13 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643


Edwin Lefevre,

you could use an if...then statement to set your Boolean variable to true. Then you can use another if... then statement to set it to back to false - for example on a new day.

Regards,

ABCTG


Edwin Lefevre View Post
Hi I am looking to stop all automated trading when a condition is met.

The condition typically only occurs once and then reverts back to the original state so I'm having trouble keeping trading stopped.

Condition1 = AvgTrueRange(1) >= 0.015;

Refers to one bar back.

How would I set this condition to continue being true after it has occured? Allowing for the creation of a statement to stop all trading for the day.


Follow me on X Reply With Quote
Thanked by:
  #4 (permalink)
Edwin Lefevre
Scotland
 
Posts: 27 since May 2019
Thanks Given: 11
Thanks Received: 4


ABCTG View Post
Edwin Lefevre,

you could use an if...then statement to set your Boolean variable to true. Then you can use another if... then statement to set it to back to false - for example on a new day.

Regards,

ABCTG

Thanks ABC

I came up with this, and it seems to be working:

if avgtruerange(1) >= 0.015 then
volatility_stop = true;

if volatility_stop = true and time > 1705 and date > date[1] then
volatility_stop = false;


Reply With Quote




Last Updated on January 8, 2020


© 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