Buy or Sell at set time and price change on any market.

Forums ProRealTime English forum General trading discussions Buy or Sell at set time and price change on any market.

Viewing 3 posts - 16 through 18 (of 18 total)
  • #237138

    I need the buy also to take into consideration certain indicator values.
    I used MACD, Stochastic, EMS and SMA values to the code but the results does not seem to take into account the indicator values.
    I will be grateful if anybody can help me please. Sure I’m just missing some small change to the existing code.
    Thank you.

    What I tried (with my limited knowledge of code).
    No matter which direction I set the < or > the results stays the same which tells me what I do isn’t working ;-(

    indicator1 = MACDSignal[2,26,9](close)
    indicator2 = MACDline[2,26,9](close)
    indicator3 = MACD[2,26,9](close)
    mac = (indicator2 > indicator1) //used all combinations > < here which does not have an effect.

    indicator4 = Stochastic[14,3](close)
    indicator5 = Stochastic[14,7](close)
    stoch = (indicator5 > indicator4) //used all combinations > < here which does not have an effect.

    indicator6 = Average[20](close)
    indicator7 = Average[50](close)
    aver1 = (indicator6 < indicator7) //used all combinations > < here which does not have an effect.

    indicator8 = ExponentialAverage[20](close)
    indicator9 = ExponentialAverage[20](Open)
    ema = (indicator10 > indicator11) //used all combinations > < here which does not have an effect.

     

    #237189

    Try adding below at bottom of your code and remove the // so as to show one without // at a time.

    So start with mac, when True you will see a 1, if never True, you will see a 0 line.

    Do same for the others and report back

    GRAPH mac
    //GRAPH stoch
    //GRAPH aver1
    //GRAPH ema

    PS I guess ema is a typo and you meant (indicator8 > indicator9)

    #237202

    Thank you for the reply.
    I’ll give your suggestion/code a go.

    I’m still looking for code that works on short time frame. Quick in and out.
    With a quick in and out on short time frame one can make the most of the market no matter the long term market trend.

Viewing 3 posts - 16 through 18 (of 18 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login