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 787 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

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

  #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?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
ZombieSqueeze
Platforms and Indicators
About a successful futures trader who didnĀ“t know anyth …
Psychology and Money Management
Better Renko Gaps
The Elite Circle
Cheap historycal L1 data for stocks
Stocks and ETFs
 
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629


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 Twitter 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


© 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