NexusFi: Find Your Edge


Home Menu

 





Plz help me translate this wonderful line in muliticharts ~


Discussion in EasyLanguage Programming

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




 
Search this Thread

Plz help me translate this wonderful line in muliticharts ~

  #1 (permalink)
uu04536
NN China
 
Posts: 1 since Oct 2016
Thanks Given: 0
Thanks Received: 0

hello ! traders , here is the program (code from MQL4):

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 LimeGreen
extern int Ha = 61;
double Avg[];

int init() {
IndicatorBuffers(1);
Ha = MathMax(Ha, 1);
SetIndexBuffer(0, Avg);
SetIndexDrawBegin(0, Ha);
return (0);
}
int start() {
int C;
double N1;
double N2;
// main code
int Li_0 = IndicatorCounted();
if (Li_0 < 0) return (-1);
if (Li_0 > 0) Li_0--;
int ak = MathMin(Bars - 1, Bars - Li_0 + Ha);

for (int i = ak; i >= 0; i--) {
N1 = (Ha + 1) * iMA(NULL, 0, 1, 0, MODE_SMA, PRICE_CLOSE, i);
N2 = Ha + 1;
C = 1;
for (int j = Ha; C <= Ha; j--) {
N1 += j * iMA(NULL, 0, 1, 0, MODE_SMA, PRICE_CLOSE, i + C);
N2 += j;
if (C <= i) {
N1 += j * iMA(NULL, 0, 1, 0, MODE_SMA, PRICE_CLOSE, i - C);
N2 += j;
}
C++;
}
Avg[i] = N1 / N2; //output the line
}
return (0);
}

you see. there are two loops inside and keep calculating [iMA....].for the second one it likely never stop....so how to translate this into Multicharts ? (if i replace the C<= Ha to j >=0 ?) thx !
thx

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
What broker to use for trading palladium futures
Commodities
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
ZombieSqueeze
Platforms and Indicators
Better Renko Gaps
The Elite Circle
 




Last Updated on October 2, 2016


© 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