Re: Coding Help

1465
Hi!

Could someone completely disable all alerts in this source code please?

This is a very interesting robot but it has the flaw that it only wins in the direction of the trend. Against the trend, it loses. That is why you have to manually modify the buys and sells according to the trend.

If this robot can even be improved so that it detects trends automatically, it would be much better.

If possible, thank you..


Re: Coding Help

1468
Can anybody suggest the correct way to get long and short trends from step NEMA indicator?

Code: Select all

bool trendLong,trendShort;

Signal1 =iCustom(NULL, 0, "step nema (mtf + alerts + arrows)",PERIOD_CURRENT,NEMAperiod, 2, 0.5, 50.0,0,false,0.0,0.0,0,3,1,false, false, false, false,false,false,159,159,2,2,0.5,0.5,true,true, 2, 0);
Signal2 =iCustom(NULL, 0, "step nema (mtf + alerts + arrows)",PERIOD_CURRENT,NEMAperiod, 2, 0.5, 50.0,0,false,0.0,0.0,0,3,1,false, false, false, false,false,false,159,159,2,2,0.5,0.5,true,true, 3, 0);

      
      if(Signal1>0 && Signal1!=EMPTY_VALUE && Signal2!=0 && Signal2!=EMPTY_VALUE)trendLong=true;
      if(Signal1>0 && Signal1!=EMPTY_VALUE && Signal2>0 && Signal2!=EMPTY_VALUE)trendShort=true;


I am using this version of indicator

Re: Coding Help

1469
kkfx wrote: Wed Apr 19, 2023 3:25 am Can anybody suggest the correct way to get long and short trends from step NEMA indicator?

Code: Select all

bool trendLong,trendShort;

Signal1 =iCustom(NULL, 0, "step nema (mtf + alerts + arrows)",PERIOD_CURRENT,NEMAperiod, 2, 0.5, 50.0,0,false,0.0,0.0,0,3,1,false, false, false, false,false,false,159,159,2,2,0.5,0.5,true,true, 2, 0);
Signal2 =iCustom(NULL, 0, "step nema (mtf + alerts + arrows)",PERIOD_CURRENT,NEMAperiod, 2, 0.5, 50.0,0,false,0.0,0.0,0,3,1,false, false, false, false,false,false,159,159,2,2,0.5,0.5,true,true, 3, 0);

      
      if(Signal1>0 && Signal1!=EMPTY_VALUE && Signal2!=0 && Signal2!=EMPTY_VALUE)trendLong=true;
      if(Signal1>0 && Signal1!=EMPTY_VALUE && Signal2>0 && Signal2!=EMPTY_VALUE)trendShort=true;


I am using this version of indicator
You can try

Code: Select all

#define _doNothing 0
#define _doBuy     1
#define _doSell    2

curTrend =iCustom(NULL, 0, "step nema (mtf + alerts + arrows)",PERIOD_CURRENT,NEMAperiod, 2, 0.5, 50.0,0,false,0.0,0.0,0,3,1,false, false, false, false,false,false,159,159,2,2,0.5,0.5,true,true, 9, 1);
preTrend =iCustom(NULL, 0, "step nema (mtf + alerts + arrows)",PERIOD_CURRENT,NEMAperiod, 2, 0.5, 50.0,0,false,0.0,0.0,0,3,1,false, false, false, false,false,false,159,159,2,2,0.5,0.5,true,true, 9, 2);

if (curtrend!=pretrend)
         if (curtrend==1)
               doWhat = _doBuy;
         else  doWhat = _doSell;
         if (doWhat==_doNothing) return;

Then enter _doBuy and _doSell in their respective places.
These users thanked the author mrtools for the post:
kkfx


Who is online

Users browsing this forum: Amazon [Bot] and 21 guests