Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Possible Crossover Alert

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 1800promote
    replied
    thank you.will try it.

    Leave a comment:


  • roonius
    replied
    Originally posted by 1800promote View Post
    well...any guidance on how to do it?..or is too complicated to try to do it myself..
    OK. Let's use two SMA's SMA10 and SMA20.
    The approach would be like this:

    CalculateOnBarClose = false;

    if(SMA(10)[0] < SMA(20)[0] && Rising(SMA(10)))
    {
    double x = Close[0];

    while((SUM(Close, 9)[1] + x)/10 <= (SUM(Close, 19)[1] + x)/20)
    {
    x+=TickSize;
    }

    if (x - Close[0] <= 2*TickSize)
    {
    Print ("Hey, we are less than two ticks away from possible crossover");
    Print (" Be Prepared to Enter Long Position");
    }
    }

    Viceversa for oposite direction.

    I just give you an idea. I did not compile this code, I am writing it directly to the forum out of my head.

    If you want to use EMA or HMA or whatever MA you should use the appropriate calculation formulas.

    Hope it helps.

    roonius

    Leave a comment:


  • 1800promote
    replied
    well...any guidance on how to do it?..or is too complicated to try to do it myself..

    Leave a comment:


  • roonius
    replied
    Originally posted by 1800promote View Post
    Hello,

    I have a simple strategy based on 2 simple moving average crossover
    Let say we are 1 bar before a possible crossover. Since the moving averages are based on the closing price..the closing price of this bar will be very important and will lead to a signal or not.
    Therefor i want to plot an alert message on the chart..something like
    "Crossover alert! If curent bar closing price will be greater/below value x.xx the moving average will cross and a position will be initiated at the openning price of the next bar."
    Basically i want to know before the bar close if the curent price of the bar will be enough to generate a crossover when the bar will be closed.
    Is this possible?
    Thank you.
    It's possible with additional calculations in the script.

    Leave a comment:


  • 1800promote
    started a topic Possible Crossover Alert

    Possible Crossover Alert

    Hello,

    I have a simple strategy based on 2 simple moving average crossover
    Let say we are 1 bar before a possible crossover. Since the moving averages are based on the closing price..the closing price of this bar will be very important and will lead to a signal or not.
    Therefor i want to plot an alert message on the chart..something like
    "Crossover alert! If curent bar closing price will be greater/below value x.xx the moving average will cross and a position will be initiated at the openning price of the next bar."
    Basically i want to know before the bar close if the curent price of the bar will be enough to generate a crossover when the bar will be closed.
    Is this possible?
    Thank you.
    Last edited by 1800promote; 02-19-2009, 11:02 PM.

Latest Posts

Collapse

Topics Statistics Last Post
Started by fmcap, Today, 10:49 PM
0 responses
2 views
0 likes
Last Post fmcap
by fmcap
 
Started by iradielt, Today, 10:06 PM
0 responses
2 views
0 likes
Last Post iradielt  
Started by gbajaj, Today, 03:35 PM
2 responses
11 views
0 likes
Last Post gbajaj
by gbajaj
 
Started by space_trader, Today, 03:19 PM
2 responses
8 views
0 likes
Last Post space_trader  
Started by max1ci6, Today, 02:02 AM
4 responses
28 views
0 likes
Last Post joromero  
Working...
X