NexusFi: Find Your Edge


Home Menu

 





How to set a "trigger bar"


Discussion in EasyLanguage Programming

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




 
Search this Thread

How to set a "trigger bar"

  #1 (permalink)
Bietto
Milan Italy
 
Posts: 4 since Mar 2020
Thanks Given: 1
Thanks Received: 0

Hi,

I'm a beginner who's studying a lot to learn how to use tradestation platform to code an automated strategy for Futures Contracts.

I need your help in order to create a simple easylanguage code to set a "trigger bar" (with some very basic given characteristics) where, referring to next bars starting from this "trigger bar", the strategy goes long (1 contract) when the current price overcome the "trigger bar" High, and goes short (1 contract) when the current price overcome the "trigger bar" Low value up until a new "trigger bar" is identified.

Could anyone please help by sending me a code example for doing this? I'm really struggling with it...

Thanks a lot!

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
NexusFi Journal Challenge - April 2024
Feedback and Announcements
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Deepmoney LLM
Elite Quantitative GenAI/LLM
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
60 thanks
Funded Trader platforms
43 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #3 (permalink)
ifcontech
Kuala Lumpur Malaysia
 
Posts: 4 since Jun 2019
Thanks Given: 0
Thanks Received: 1


what do you mean by trigger bar?

how do you define the trigger?

it should be codded,

if condition1=true then

{ whatever you need to do here}


you will need to define what is the point to trigger the condition before you making a buy.

Reply With Quote
Thanked by:
  #4 (permalink)
Bietto
Milan Italy
 
Posts: 4 since Mar 2020
Thanks Given: 1
Thanks Received: 0

Hi ifcontech,

first of all I would like to thank you very much for your very appreciated reply and and for your try to help me in coding my idea.

I try to be more clear as I can imagine my previous message was a little bit confusing...

The "trigger bar" is a bar that satisfy some given conditions. The "trigger bar" has two trigger points (Bar High and Bar Low).

What I need to code is, referring to following bars starting from the identified one, a buy order (1 contract) when the current price violate the High value of the "trigger bar", and a short order (1 contract) when the current price violate the Low value of the "trigger bar".

This mechanism must be in place until a new "trigger bar" is identified, and do do the same for the following bars.

Basically the system should store my trigger points (high and low of the "trigger bar") and overwrite them when a new trigger bar is identified and do the same again and again.


Please take a look to the attached drawing which I believe can better clarify my point.

Thanks a lot again for your help!

Attached Thumbnails
Click image for larger version

Name:	Example Trigger Bar.PNG
Views:	199
Size:	16.1 KB
ID:	292056  
Reply With Quote
  #5 (permalink)
ifcontech
Kuala Lumpur Malaysia
 
Posts: 4 since Jun 2019
Thanks Given: 0
Thanks Received: 1

how do you identify the trigger bar?

for buy, what i understand is it will buy whenever it break the trigger bar high, but when you have position when do you sell?

Reply With Quote
  #6 (permalink)
Bietto
Milan Italy
 
Posts: 4 since Mar 2020
Thanks Given: 1
Thanks Received: 0

If a certain bar satisfy some conditions this will be the first "trigger bar". What I need to do is write a code that store the High and the Low value of this trigger bar and send orders to market for buying and selling not only fore next bar, but also for all the following bars until a new "trigger bar" is identified (you can see also from the pictures I sent you).
MP is always =1 or -1.

going back to your question:
for buy, what i understand is it will buy whenever it break the trigger bar high, but when you have position when do you sell?

The system should sell when the low of a trigger bar is violated. It will never be MP=2 or MP=-2. If a double long or short signal is received it will stay in the position.

Hope is clear. Thanks!

Reply With Quote




Last Updated on March 30, 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