NexusFi: Find Your Edge


Home Menu

 





Print values only when they met a condition


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
jlsegsan
Madrid
 
Posts: 10 since Feb 2018
Thanks Given: 0
Thanks Received: 0

Apologies in advance I am an absolute beginner

I coded a simple indicator to plot 3 moving averages
Then I add the condition of the first 2 crossing
I want to apply this indicator to the Radar where I have selected some values
My info extraction would be very simple at first:

- Future / Stock - Date - Value at which the 2 Moving Averages have crossed
but get data extraction only in the date in which I have a crossing, I don't need the Dates and Values without any Moving average crossing

I have managed to write the Plot part, even the Condition, but I don't know how to code the Print part

Your help would be really appreciated

My coding:

Inputs:

Price (Close),
Length1 (2),
Length2 (11),
Length3 (22),
ConfirmBars( 1 ) ;

Variables:

FileName (" "),
Counter( 0 );
{ Plot1 Averages on chart }

Plot1 ( AverageFC(Price , Length1), "Avg1");
Plot2 ( AverageFC(Price , Length2), "Avg2");
Plot3 ( AverageFC(Price , Length3), "Avg3");


if AverageFC(Price, Length1) > AverageFC( Price, Length2 ) then
Counter = Counter + 1;
if Counter = ConfirmBars then


Print ("Date -",ELDateToString(Date)," Avg1", Plot1:3.3, " Avg2", Plot2:3:4, " Avg3", Plot3:3:5) ;
If Currentbar = 1 then Print(File("C:\TestTemp.txt"),"Date - ",";"," Avg1 ",";"," Avg2 ",";"," Avg3 ") ;
Print(File("C:\TestTemp.txt"), ELDateToString(Date),";", Plot1:3.3, ";", Plot2:3:4, ";", Plot3:3:5) ;


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Wood Mackenzie Drops $200 Oil Forecast -- Airspace Expir …
Prediction Markets & Event Contracts
Penalties in Budapest, Peace Deadline in Tehran: Arsenal …
Prediction Markets & Event Contracts
Four New E-mini Futures Launch June 29 -- Russell 3000, …
Emini and Emicro Index
Ceasefire Collapse: Iran Fires 24 Missiles, Israel Hits …
Traders Hideout
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
197 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
BERN ALGOS algo trading journal
8 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642


jlsegsan,

check this thread: . @Big Mike this thread can probably be closed as duplicate.

Regards,

ABCTG


Follow me on X Reply With Quote




Last Updated on February 2, 2018


© 2026 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 - Downloads - Top
no new posts