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 cmetraderr with 2 posts (0 thanks)
    2. looks_two Big Mike with 2 posts (2 thanks)
    3. looks_3 tradernovice with 2 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,850 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?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Request for MACD with option to use different MAs for fa …
NinjaTrader
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
67 thanks
NexusFi site changelog and issues/problem reporting
47 thanks
Battlestations: Show us your trading desks!
43 thanks
GFIs1 1 DAX trade per day journal
32 thanks
What percentage per day is possible? [Poll]
31 thanks

  #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,322 since Jun 2009
Thanks Given: 33,143
Thanks Received: 101,476



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

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
The following user says Thank You to Big Mike for this post:
  #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,322 since Jun 2009
Thanks Given: 33,143
Thanks Received: 101,476

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

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
The following user says Thank You to Big Mike for this post:





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