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,212 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?
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
ATFX Suspends Prop Trading Unit ATFunded -- Full Review …
Funded Trading Evaluation Firms
Election Sunday Resolves: Peru Heads to Runoff at 42pct, …
Prediction Markets & Event Contracts
Powell in 48 Hours: Word Markets Give 78% on Inflation, …
Prediction Markets & Event Contracts
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642


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