Q on signal counting in MC - EasyLanguage Programming | futures io social day trading
futures io futures trading


Q on signal counting in MC
Updated: Views / Replies:1,447 / 6
Created: by aczk Attachments:0

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 
Thread Tools Search this Thread
 

Q on signal counting in MC

  #1 (permalink)
Elite Member
London, UK
 
Futures Experience: Intermediate
Platform: MultiCharts
Favorite Futures: equities, futures
 
Posts: 36 since Jan 2012
Thanks: 3 given, 2 received

Q on signal counting in MC

Hi guys

How do I count signals, like a crossover on an indicator, while also filtering out the ones I do and do not want count be bar distances.

Like MA cross, count 1, then if it crosses again within 20 bars don't count it, count if above and set as condition for the next part??? Just to get rid of jittery indicator action...

Thx & appreciate any help

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received



aczk View Post
How do I count signals, like a crossover on an indicator, while also filtering out the ones I do and do not want count be bar distances.

Like MA cross, count 1, then if it crosses again within 20 bars don't count it, count if above and set as condition for the next part?

Can you elaborate somewhat on your question? Perhaps show your code so far?

I don't think I follow you completely - when do you want to count it, and exactly when doesn't it count? And: "count if above and set as condition for the next part" - count what (crossovers, bars)? Which condition (cross over condition, bar count < 20 condition)? And which "part"?

I don't get it.

Reply With Quote
 
  #4 (permalink)
Elite Member
London, UK
 
Futures Experience: Intermediate
Platform: MultiCharts
Favorite Futures: equities, futures
 
Posts: 36 since Jan 2012
Thanks: 3 given, 2 received

Hi thx for taking a look...


For example:
1 Price crosses above the MA, I want MC to count one signal.
2 Price crosses below MA and above again within, say within 30 bars. I don't want MC to count this, too close.
3 Price crosses above MA a third time after 50 bars, which I want to count.
4 Count should be 2 now.
5 Now Stochastic cross above 50 and count = 2, I want to go Long.

So how to count signals and filter counts by bar distances in-between them.

Thx

Reply With Quote
 
  #5 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


aczk View Post
For example:
1 Price crosses above the MA, I want MC to count one signal.
2 Price crosses below MA and above again within, say within 30 bars. I don't want MC to count this, too close.
3 Price crosses above MA a third time after 50 bars, which I want to count.
4 Count should be 2 now.
5 Now Stochastic cross above 50 and count = 2, I want to go Long.

Ah I see.

Something like the following should get you started:
 
Code
Variables:
    countedSignals(0), barNumberOfSignal(0), maQuick(0), maSlow(0), stochD(0), stochK(0);
    
maQuick = XAverage(Close, 5);
maSlow     = XAverage(Close, 20);
value20 = Stochastic(High, Low, Close, 12, 3, 3, 1, value99, value98, stochK, stochD);

if (maQuick crosses above maSlow) then begin

    // 1. Price crosses above the MA, I want MC to count one signal.
    if (countedSignals = 0) then begin
        countedSignals = 1;
    
        barNumberOfSignal = CurrentBar;
    end;    
    
    // 2. Price crosses below MA and above again within, say within 30 bars. I don't want MC to count this, too close.
    // 3. Price crosses above MA a third time after 50 bars, which I want to count.
    // So, there have to be at least 50 bars since the first cross over
    if ((CurrentBar - barNumberOfSignal) > 50) then
        countedSignals = countedSignals + 1;

end;

// 4. Count should be 2 now.
// 5. Now Stochastic cross above 50 and count = 2, I want to go Long.
if (countedSignals = 2) and (stochK crosses above 50) then
    Buy ("EL#1") 1 contracts next bar at market;
    
// Reset 'countedSignals' to 0 after a closed position, so
//    the code can start looking for the next trade
if (BarsSinceExit(1) < 3) then
    countedSignals = 0;
See the comments in the code above for explanation and your comments translated to MC.

Good luck!

Reply With Quote
The following 3 users say Thank You to Jura for this post:
 
  #6 (permalink)
Elite Member
London, UK
 
Futures Experience: Intermediate
Platform: MultiCharts
Favorite Futures: equities, futures
 
Posts: 36 since Jan 2012
Thanks: 3 given, 2 received

Hi thx for taking the time for the code...
somewhat cant get it to work though.

I dojt want two MAs two cross, but just filter several consecutive price over MA crosses. Don't count the ones two close together, e.g. two quick whipsaws. Then go long after the third cross if another indicator crosses a certain spot/value.

Thanks for any advice on this

Reply With Quote
 
  #7 (permalink)
Elite Member
near Paris, France
 
Futures Experience: Beginner
Platform: -
Favorite Futures: -
 
Nicolas11's Avatar
 
Posts: 1,070 since Aug 2011
Thanks: 2,232 given, 1,729 received

Hi aczk,

One of the best MultiCharts programmer of this forum took time to code exactly what you specified, and your answer is the one above.

Apparently, the answer does not satisfy you. But I personally have understood your question the same as Jura did.

If you want a solution to your problem, you will probably find it on futures.io (formerly BMT). But, please, explain clearly what you want. And "clearly" means "not as in messages #1 and #6".

Nicolas

Reply With Quote
The following user says Thank You to Nicolas11 for this post:

Reply



futures io > > > > > Q on signal counting in MC

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting Elliott waves Billbb Emini Index Futures Trading 4 October 7th, 2016 06:36 PM
MC Traders dynamic index -> conveting to MC yiman MultiCharts 12 August 2nd, 2016 11:40 AM
Counting Bars since open of session zeller4 NinjaTrader Programming 5 September 17th, 2014 08:55 PM
NT 7 Counting the amount of bars in a swing david666 NinjaTrader Programming 3 July 11th, 2010 10:49 AM
Counting Consecutive Bars kaywai NinjaTrader Programming 4 January 17th, 2010 10:40 AM


All times are GMT -4. The time now is 08:48 PM.

Copyright © 2017 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
Page generated 2017-12-16 in 0.11 seconds with 19 queries on phoenix via your IP 54.160.245.121