Click here to Login





                                                   Plot a Macd crossover

  0

0
Rob
2017-03-25 00:54:57


The following code is not working. Can someone tell me how to get arrows on the screen when the Macd generates a buy or sell signal?

temp4 = MacdExtSignal(12,_MaEma,26,_MaEma,9,_MaEma);
a = cross(temp4, 0);
plotarrow(a,a,belowLow,colorRed);



QuantShare
2017-03-27 04:11:37

  0

The above code plots and arrow when the Macd crosses above the zero line.
You plot the Macd line and get a visual confirmation.

What do you mean by "Macd generates a buy or sell signal", how do you define that?



Rob
2017-03-27 08:21:53

  0

I figured it out. It should have been

temp4 = MacdExtSignal(12,_MaEma,26,_MaEma,9,_MaEma);
a = cross(temp4, 0);
plotarrow(a,a,belowLow,colorRed);
a = cross(0,temp4);
plotarrow(a,a,belowLow,colorRed);



No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Plot Economic Indicators on a Chart
Multiple Time Frames Trading System - Price / Moving Average Cros...
Market Rule based on the Crossover Between Stock Close prices and...
Occurrence Since
Number of Times an Event Occurred in the First N-Minutes of a Tra...

How-to Lessons
How to plot news on a chart?
How to plot two different time frames in the same chart
How to plot arrows below/above candlesticks on a chart
How to plot the relative performance of several stocks/indices
How to plot the number of stock tweets per day

Related Forum Threads
plot indicator as drawing tool
Regarding crossover function in case of realtime QS
MACD settings
MA crossover
Plot Threshold Lines

Blog Posts
Trading System: Moving average crossover and few others buy and s...
Backtesting chart patterns using the auto support and resistance ...
The Ultimate Guide to Create Trading Systems in QuantShare
How to predict and trade the stock market using pivot points
Real Time Alerts: Support and Resistance Lines Breakout









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright 2021 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.