Do not double post.
I have deleted your other topic.
Please tell me how to improve it and eliminate order 130. I have TradersWay for my broker, it is a 3/5 digit broker, there is no stop level. I had to put in a parameter for if the new stop loss is greater than old stop loss to prevent it to modify to lower value. I did forget to mention I have not run this on ticks in Strategy Tester, I do not have the real tick data purchased from outside source yet, so I cannot conclude this to be a fully improper functional code but even with using control points or open prices, a program can still initiate to close to 70% efficiency.
I did update the code and clean it up a bit, I have not added the percentage part for sell yet.
error order 130
Error 130 mean that your stop loss are too close of the Bid or Ask, if must be to a distance minimum of MarketInfo(NULL,MODE_STOPLEVEL)*Point ;
error order 130
You put your code into en init() fonction, does it work in init() ?
You better put your code into a script, it would be read and execute only once
Error 130 mean that your stop loss are too close of the Bid or Ask, if must be to a distance minimum of STOP_LEVEL
Surprisingly, it does work from init function. I am still cleaning everything up. I am learning to not assign stoploss levels to a variable especially when comparing in a conditional parameter.
No It was ok, it's not in the init();
you have to start whit something more simple and compréhensible, and clear the meaning ot
extern int When_to_Move_to_Break_Even=10.0; extern int Move_Break_Even=2;
if(OrderType()==OP_BUY) { be_buy = OrderOpenPrice() + When_to_Move_to_Break_Even*vPoint; // 100 point if(Bid > be_buy && (Bid - be_buy) > MarketInfo(NULL,MODE_STOPLEVEL)*Point ) { ans = false; ans=OrderModify(OrderTicket(),OrderOpenPrice(),be_buy,OrderTakeProfit(),0,clrNONE); if( ans == false ) Print("ERROR" ); } }
I did not test this,
No It was ok, it's not in the init();
you have to start whit something more simple and compréhensible, and clear the meaning ot
I did not test this,
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Please tell me how to improve it and eliminate order 130. I have TradersWay for my broker, it is a 3/5 digit broker, there is no stop level. I had to put in a parameter for if the new stop loss is greater than old stop loss to prevent it to modify to lower value. I did forget to mention I have not run this on ticks in Strategy Tester, I do not have the real tick data purchased from outside source yet, so I cannot conclude this to be a fully improper functional code but even with using control points or open prices, a program can still initiate to close to 70% efficiency.
I did update the code and clean it up a bit, I have not added the percentage part for sell yet.