[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 by ABCTG
    1. trending_up 249 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 7 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,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)

 
Thread Tools Search this Thread
 

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

  #1 (permalink)
Hong Kong
 
 
Posts: 6 since Feb 2019
Thanks: 1 given, 1 received

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

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?


Last edited by FDZL; June 4th, 2019 at 02:20 AM.
Reply With Quote

Can you help answer these questions
from other members on futures io?
Convert NinjaTrader NT7 indicator to Tradestation EasyLanguage and RADARSCREEN
Platforms and Indicators
Issue meeting order entry conditions
Elite Automated NinjaTrader Trading
Last 5 minutes Label
ThinkOrSwim
Moving average with Lag reduction
NinjaTrader
Linux?
ThinkOrSwim
 
 
  #2 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,178 since Apr 2013
Thanks: 384 given, 1,411 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
 
  #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
 
  #4 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,178 since Apr 2013
Thanks: 384 given, 1,411 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
 
  #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
 
  #6 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,178 since Apr 2013
Thanks: 384 given, 1,411 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
 
  #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:
 
  #8 (permalink)
Hamburg Germany
 
Experience: Advanced
Platform: Multicharts, Tradestation
Broker: DTN IQ
Trading: ES
 
Posts: 2,178 since Apr 2013
Thanks: 384 given, 1,411 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




Upcoming Webinars and Events
 

Free BloodHound Licenses to everyone!

June
 

Every journal equals ten meals for the hungry

June
     



Copyright © 2020 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