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 785 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?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
36 thanks
Tao te Trade: way of the WLD
24 thanks
Spoo-nalysis ES e-mini futures S&P 500
20 thanks
Bigger Wins or Fewer Losses?
19 thanks
GFIs1 1 DAX trade per day journal
16 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627


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