[Condition] IF B happen within a timeframe after A happen, then C - futures io
futures io futures trading



[Condition] IF B happen within a timeframe after A happen, then C


Discussion in MultiCharts

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




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

[Condition] IF B happen within a timeframe after A happen, then C

(login for full post details)
  #1 (permalink)
Hong Kong
 
 
Posts: 6 since Feb 2019
Thanks: 1 given, 1 received

Hi all,

If I want to code this :

IF B happen within a timeframe after A happen, then C

How can I code this into powerlanguage please?

Reply With Quote

Can you help answer these questions
from other members on futures io?
DMIC 2059 program
Traders Hideout
Simulated Playback Trading
EasyLanguage Programming
the link between CFDs brokers and bank spot liquidity?
Currencies
The war of the two worlds (options traders vs futures traders)
The Elite Circle
Market trading data-streaming or gaming in NT8?
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Big Mike in Ecuador
83 thanks
How did you learn to trade?
81 thanks
2020 profit and loss results
74 thanks
NinjaTrader buys TransAct Futures (Infinity Brokers), plans its own FCM
64 thanks
Whos afraid of the big bad Glitch
51 thanks
 
(login for full post details)
  #2 (permalink)
Vendor
 
 
Posts: 2,225 since Apr 2013
Thanks: 406 given, 1,468 received

Hi FDZL,

can you show an example to clarify what you mean by "within a timeframe"?

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
 
(login for full post details)
  #3 (permalink)
Hong Kong
 
 
Posts: 6 since Feb 2019
Thanks: 1 given, 1 received



ABCTG View Post
Hi FDZL,

can you show an example to clarify what you mean by "within a timeframe"?

Regards,

ABCTG

Hi ABCTG,

Thanks for replying.

For example, if B happen with 1 minute after A = true (and therefore can not use If..and...then statement) , then C;

Is it possible to code this?

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Vendor
 
 
Posts: 2,225 since Apr 2013
Thanks: 406 given, 1,468 received

Hi FDZL,

the approach will depend a bit on the timeframe you are working on. If you are working on one minute bars you could store the value of the reserved CurrentBar in a variable when your code detects condition A.
Then you can compare the current value of CurrentBar against the stored value when you evaluate your condition B.

Regards,

ABCTG


FDZL View Post
Hi ABCTG,

Thanks for replying.

For example, if B happen with 1 minute after A = true (and therefore can not use If..and...then statement) , then C;

Is it possible to code this?


Follow me on Twitter Visit my Facebook Reply With Quote
 
(login for full post details)
  #5 (permalink)
Hong Kong
 
 
Posts: 6 since Feb 2019
Thanks: 1 given, 1 received


ABCTG View Post
Hi FDZL,

the approach will depend a bit on the timeframe you are working on. If you are working on one minute bars you could store the value of the reserved CurrentBar in a variable when your code detects condition A.
Then you can compare the current value of CurrentBar against the stored value when you evaluate your condition B.

Regards,

ABCTG

Dear ABCTG,

But my case is that condition A is a exit action ( Sell / buy to cover ) and I am not too sure if this can be code into condition....

IE " sell all contract next bar at market " cannot really be coded into condition in multi chart as far as I'm concerned.

Is there any way around this ? Much appreciated for your assistance.

Reply With Quote
 
(login for full post details)
  #6 (permalink)
Vendor
 
 
Posts: 2,225 since Apr 2013
Thanks: 406 given, 1,468 received

FDZL,

do you use any condition to decide when to trigger the exit? If so, use that, too. If not, you could for example monitor the change in the market position (to now being flat) or detect a particular exit name etc.. to set the value of the variable.

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
 
(login for full post details)
  #7 (permalink)
Hong Kong
 
 
Posts: 6 since Feb 2019
Thanks: 1 given, 1 received


ABCTG View Post
FDZL,

do you use any condition to decide when to trigger the exit? If so, use that, too. If not, you could for example monitor the change in the market position (to now being flat) or detect a particular exit name etc.. to set the value of the variable.

Regards,

ABCTG

My problem is solved with your set value of the variable advise!

Thank you so much for your kind assistance!

Reply With Quote
The following user says Thank You to FDZL for this post:
 
(login for full post details)
  #8 (permalink)
Vendor
 
 
Posts: 2,225 since Apr 2013
Thanks: 406 given, 1,468 received

FDZL,

you are welcome and thank you for your feedback.

Regards,

ABCTG


FDZL View Post
My problem is solved with your set value of the variable advise!

Thank you so much for your kind assistance!


Follow me on Twitter Visit my Facebook Reply With Quote


futures io Trading Community Platforms and Indicators MultiCharts > [Condition] IF B happen within a timeframe after A happen, then C


Last Updated on June 6, 2019


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Are you doing what it takes to trade right? w/FuturesTrader71

Jan 21
 

Journal Challenge!

February
 

Battlestations!

March
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts