Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (SBGuy, Petra, flink, AndrewAMD, 1 invisible), 687 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
plot: PLOTNOW, plot(), enterLong() #483437
05/31/21 00:00
05/31/21 00:00
Joined: May 2021
Posts: 1
Valley View
P
Phantom377 Offline OP
Guest
Phantom377  Offline OP
Guest
P

Joined: May 2021
Posts: 1
Valley View
Hi All
I am new, sorry for my basic questions.

this works as expected: it creates a plot 1

set(PLOTNOW);
set(LOGFILE);
vars Prices = series(price(0));
plot("price", price(), MAIN, RED);

If I add some more lines, it creates on the chart additional plots I have not asked for (plot 2)
function run()
{
set(PLOTNOW);
set(LOGFILE);
vars Prices = series(price(0));
plot("price", price(), MAIN, RED);
vars Trends = series(LowPass(Prices,500));
hours or aligning to the end of day.
Stop = 4*ATR(100);
var delta = ATR(100) - ATRS(100);
printf("delta = %f; ", delta);
vars MMI_Raws = series(MMI(Prices,300));
vars MMI_Smooths = series(LowPass(MMI_Raws,300));
if(falling(MMI_Smooths))
{
if(valley(Trends))
enterLong(); // for some reason (beause of set(plotnow) this part is ploted even if I am not asking for plotting them
else if(peak(Trends))
enterShort(); // for some reason (beause of set(plotnow) this part is ploted even if I am not asking for plotting them
}
}

My understanding is that the combination "set(PLOTNOW)" + "valley(Trends)" or "peak(Trends)" is sufficient for generating the additional plots.

How do I have to code for plotting only what I want?
How to change the above code for plotting "price" but not the part into the "if"

Thanks

Attached Files plot-1.PNGplot-2.PNG
Re: plot: PLOTNOW, plot(), enterLong() [Re: Phantom377] #483440
05/31/21 13:00
05/31/21 13:00
Joined: Apr 2021
Posts: 41
Slovakia
T
tomna1993 Offline
Newbie
tomna1993  Offline
Newbie
T

Joined: Apr 2021
Posts: 41
Slovakia
The grey vertical bar plot is the equity, the green line with two dots are representing a closed trade with positive profit. You can turn off the equity plot by deactivating the Equity button in the chart viewer.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1