NexusFi: Find Your Edge


Home Menu

 





Basic MC Signal question


Discussion in MultiCharts

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




 
Search this Thread

Basic MC Signal question

  #1 (permalink)
NWItrader
Rice Lake Wisconsin
 
Posts: 5 since Jun 2013
Thanks Given: 0
Thanks Received: 0

Hello All- In spite of hundreds of hours working with MultiCharts I would put myself squarely in the beginner column. So bear with me.

I have been backtesting various strategies and expanding my easylanguage vocabulary.

It appears to me that a signal ending with with something of the form:

If Condition1 and Condition2 and Condition3 and Condition4

Then
Sell (or Buy)...

Is functionally equivalent to :

If Condition1 and Condition2

Then

If Condition3 and Condition4

Then

Buy (or Sell)...

So if I have this right, in either layout Condition 1, 2 and 3 and 4 must be true simultaneously for a signal to be generated.

What I want to do is create a signal that is tiered so that when the first group of conditions are true they will act as a permanent ON trigger (which will remain ON even if the conditions are no longer all true)to allow the program to wait for a second group of conditions to become true which finally execute the Buy or Sell.

Is this possible? Thanks

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Are there any eval firms that allow you to sink to your …
Traders Hideout
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Build trailing stop for micro index(s)
Psychology and Money Management
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Deepmoney LLM
Elite Quantitative GenAI/LLM
 
  #2 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


NWItrader View Post
What I want to do is create a signal that is tiered so that when the first group of conditions are true they will act as a permanent ON trigger (which will remain ON even if the conditions are no longer all true)to allow the program to wait for a second group of conditions to become true which finally execute the Buy or Sell.

Hm, perhaps like this?

 
Code
Variables:
    firstCondition(false),
    secondCondition(false);
  
firstCondition = (Condition1 and Condition2) or firstCondition[1];

secondCondition = (Condition3 and Condition4);

if (firstCondition and secondCondition) then begin

    // Buy or sell here

end;
Here the `firstCondition` variable is either `Condition1 and Condition2` or the previous bar value (`firstCondition[1]`). That means that, when the previous bar value was true, `firstCondition` will be true for this bar also.

Because the `firstCondition` variable is created with an initial value of `false`, it can only become true when `Condition1 and Condition2` are true. But then it will keep its `true` value because of `firstCondition[1]`.

Reply With Quote
Thanked by:
  #3 (permalink)
NWItrader
Rice Lake Wisconsin
 
Posts: 5 since Jun 2013
Thanks Given: 0
Thanks Received: 0


Thanks for the idea After considerable work I couldn't get the code to execute. Something hiding in there the software didn't like. But I changed direction bit and ended up with a signal I like. When I have time I will work look at it again.

One question- Was your suggestion a new idea you thought of in response to my question, or a general layout you have used in a working signal? Thanks again.

Reply With Quote




Last Updated on October 22, 2015


© 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