NexusFi: Find Your Edge


Home Menu

 





SMA with Discretionary Start Time and Start Date for MC


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Big Mike with 2 posts (2 thanks)
    2. looks_two tradernovice with 2 posts (0 thanks)
    3. looks_3 cmetraderr with 2 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,890 views
    2. thumb_up 2 thanks given
    3. group 1 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

SMA with Discretionary Start Time and Start Date for MC

  #1 (permalink)
 tradernovice 
Venice/Italy
 
Experience: Intermediate
Platform: MetaTrader4
Broker: Oanda
Trading: EurUsd
Posts: 23 since Jun 2011
Thanks Given: 361
Thanks Received: 9

Hi everybody,
I am posting here because I would like to have a Simple Moving Average with the possibility to imput a discretionary start time and start date.
I hope that it could be possible.
Anybody could help me?
I know nothing about Easy Language and for this reason I would need the complete code.
Many thanks in advance for the help.
tn

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
Quantum physics & Trading dynamics
The Elite Circle
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
Trade idea based off three indicators.
Traders Hideout
 
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,469 since Jun 2009
Thanks Given: 33,246
Thanks Received: 101,669



tradernovice View Post
Hi everybody,
I am posting here because I would like to have a Simple Moving Average with the possibility to imput a discretionary start time and start date.
I hope that it could be possible.
Anybody could help me?
I know nothing about Easy Language and for this reason I would need the complete code.
Many thanks in advance for the help.
tn

You basically want it to start calculating not based on your session chart time or first bar, but based on a certain time of day?

If so, you could do something like this (untested)

 
Code
inputs:
   starttime (0930),
   length (20);

vars:
  mysma(0),
  todaybars(0);

if date <> date[1] then begin
  todaybars = 0;
end;

todaybars += 1;

if Time > starttime and todaybars > length then begin
  mysma = Average(C, length);
end;

Plot1(mysma, "My SMA");
But the problem comes at the end of day, and starting next day. I am not clear on how to programatically erase the mysma dataseries values and start over at the end of the day. My guess is you would need to create your own array and do it manually, unless someone else knows a way to do it.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 tradernovice 
Venice/Italy
 
Experience: Intermediate
Platform: MetaTrader4
Broker: Oanda
Trading: EurUsd
Posts: 23 since Jun 2011
Thanks Given: 361
Thanks Received: 9

Hi Mike,
thanks for the code and for the quick reply.
The code works as it is but it reset each change of day.
I was rather thinking about a sma in which to set a precise start for example start at time 09:00:00 of the day 6 of the month of july of 2011 and let it go for many days untill desired.
The purpous would be to set the start when a main shift happens in an high time frame and to let the sma run untill the trend itself runs.
Thanks since now to you and to everybody will help me.
tn

Started this thread Reply With Quote
  #5 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,469 since Jun 2009
Thanks Given: 33,246
Thanks Received: 101,669

The easiest way to accomplish this is to just create a new chart with those date ranges you want. In MultiCharts you just go to the chart properties and change start and end date accordingly.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on July 29, 2011


© 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